Posted on 02-15-2019 08:42 AM
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?
Solved! Go to Solution.
Posted on 02-18-2019 04:00 AM
@amccarty Rather than escaping the spaces with a backslash, you just need to substitute the spaces with %20
Posted on 02-18-2019 04:00 AM
@amccarty Rather than escaping the spaces with a backslash, you just need to substitute the spaces with %20
Posted on 02-18-2019 05:17 AM
@jsherwood Worked a treat, thanks!