Skip to main content
Solved

Getting Mysides to add sidebar items containing spaces?


amccarty
Forum|alt.badge.img+7

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?

Best answer by jsherwood

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

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+7
  • Contributor
  • 38 replies
  • Answer
  • February 18, 2019

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


amccarty
Forum|alt.badge.img+7
  • Author
  • Contributor
  • 15 replies
  • February 18, 2019

@jsherwood Worked a treat, thanks!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings