Sublime Forum

Documentation bug: OS X subl command

#1

Every time I set up a new OS X machine, I want to set up the “subl” command-line shortcut.

I usually end up here: https://www.sublimetext.com/docs/3/osx_command_line.html

But the path there is wrong. It should be:
ln -s "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl

(with the spaces escaped). It’s minor but I hit it every time and I imagine many other people do too. Could this be changed by anyone here?

Appreciated if so! :slight_smile:

0 Likes

#2

The instructions you linked are correct. You only need to escape the spaces when the argument is not quoted:

# quoted
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
# or unquoted
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl ~/bin/subl

This is incorrect:

ln -s "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl

# when run:
$ ~/bin/subl ~/.bash_profile
-bash: /Users/srbs/bin/subl: No such file or directory
1 Like