Getting Mysides to add sidebar items containing spaces?

amccarty
New Contributor III
New Contributor III

I'm using mysides to add mounted network shares to our user's sidebars.

It works great for share names containing no spaces, but we have some shares that do contain spaces and i'm having no luck with them.

Here's my script:

#!/bin/bash

# Add Sidebar Shortcuts
if [ ! -e /Users/$3/.sidebarshortcuts ]
  then
    echo "Adding Sidebar Shortcuts"
    su - $3 -c "/usr/local/bin/mysides add public file:///Volumes/public"
    su - $3 -c "/usr/local/bin/mysides add personal file:///Volumes/anthonymc"
    su - $3 -c "/usr/local/bin/mysides add design file:///Volumes/design folders"
    su - $3 -c "/usr/local/bin/mysides add accounts file:///Volumes/national accounts"
    su - $3 -c "/usr/local/bin/mysides add photostudio file:///Volumes/photostudio"
    touch /Users/$3/.sidebarshortcuts
fi

So out of the above shares everything gets added to the sidebar fine except for:
/Volumes/design folders
/Volumes/national accounts

I've tried using quotes as well as the backslash to tell it there is a space there, but no matter what it won't recognise the drives even though they are definitely mounted. A shortcut does appear with the name I have given it, but it's just a broken link.

Am I missing something here?

1 ACCEPTED SOLUTION

jsherwood
Contributor

@amccarty Rather than escaping the spaces with a backslash, you just need to substitute the spaces with %20

View solution in original post

2 REPLIES 2

jsherwood
Contributor

@amccarty Rather than escaping the spaces with a backslash, you just need to substitute the spaces with %20

amccarty
New Contributor III
New Contributor III

@jsherwood Worked a treat, thanks!