1

Where is Shake's environment variable located in macOS allowing to launch Shake.app via Terminal session in High Sierra?

There's no Shake's variables in ~/.bash_profile, /etc/profile and /etc/bashrc.

enter image description here

0

You're able to access the shake command line tool because it's in a directory that's listed in the PATH environment variable in your environment.

If you want to know the precise location of the shake executable you can type:

which shake

Which will list the first place it finds the shake executable when it searches all the directories in the PATH environment variable.

If you want to see all the places shake exists you can type:

which -a shake

And that will list all of the places where a command called shake can be found. I don't have shake on my machine, but here's an example using bash. The first occurence of the bash executable for me:

IanCsiMac:~
> which bash
/usr/local/bin/bash

And all the places I can find a bash executable in my PATH:

IanCsiMac:~
> which -a bash
/usr/local/bin/bash
/usr/local/bin/bash
/bin/bash

And my PATH variable looks like this:

IanCsiMac:~
> perl -e 'print join("\n", split(/:/,$ENV{"PATH"}))'
/Users/ian/.gem/ruby/2.3.1/bin
/Users/ian/.rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/bin
/Users/ian/.rubies/ruby-2.3.1/bin
/usr/local/sbin
/usr/local/bin
/Users/ian/google-cloud-sdk/bin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Applications/Server.app/Contents/ServerRoot/usr/bin
/Applications/Server.app/Contents/ServerRoot/usr/sbin
/usr/local/MacGPG2/bin
/usr/local/mysql/bin
/Users/ian/bin
/opt/nginx/sbin
/opt/local/bin
/opt/local/sbin
/Users/ian/Development/go/bin
1

Bash command which shake gives me the following result:

/usr/bin/shake

And the content of the shake file in /usr/bin/ contains a script like this:

# set env var, NR_SHAKE_LOCATION if not set

if ${?NR_SHAKE_LOCATION} == 0 then
    pushd `dirname $0` >& /dev/null
    setenv NR_SHAKE_LOCATION /Applications/Shake
    popd >& /dev/null
endif

# launch shake

exec ${NR_SHAKE_LOCATION}/shake.app/Contents/MacOS/shake $argv:q

You must log in to answer this question.