macos – Issue trying to run chrome in a bash script on mac

macos – Issue trying to run chrome in a bash script on mac

/Applications/Google Chrome.app/Contents/MacOS/Google Chrome

Here you escaped spaces ( ) to tell the shell that this string is whole, not program and its arguments.

Alternative is to use quotes, i.e. foo a b is effectively the same as foo a b. When we are using quotes, we dont escape spaces, so it should be:

EXEC=/Applications/Google Chrome.app/Contents/MacOS/Google Chrome

You double-quoted. foo bar is already equivalent to foo bar (really, foo bar, but except for the space, none of the characters has a special meaning that needed to be escaped, so e.g. f evaluates to f).

foo bar, then, is equivalent to foo\ bar; the quoted backslash is literal, rather than quoting the following space.

macos – Issue trying to run chrome in a bash script on mac

Leave a Reply

Your email address will not be published.