I'm trying to specify a variable for opening up a file with a particular app, but no matter how I attempt to reference it, it's not working.
sublime1=/Applications/Sublime\ Text.app/
sublime2="/Applications/Sublime\ Text.app/"
sublime3="/Applications/Sublime Text.app/"
I've been trying different ways of setting the variable, but for each of the variations I've tried, it fails.
open ~/.zshrc -a $sublime1
open ~/.zshrc -a $sublime2
open ~/.zshrc -a $sublime3
The file /Users/matthew/Text.app does not exist
It gives me the same error for each, so I assume they're equivalent. Even when I try cd $sublime
it also fails, but slightly differently...
bash: cd: /Applications/Sublime: No such file or directory
Update:
It was suggested by Charles to use a function to accomplish the task of quickly opening something in sublime.
sublime() { open "$@" -a "/Applications/Sublime Text.app/"; }
Will allow you to simply run
sublime ~/.zshrc