ctwise Posted January 29, 2013 Posted January 29, 2013 The bash scripts aren't executed in a login session so they don't have access to the environment setup in the bash scripts. So, if I want to implement a 'run' workflow that allows me to execute any command-line application, I can't make use of 'compgen -c' in a bash script because it doesn't have access to the user's path, just the default path.
jdfwarrior Posted January 30, 2013 Posted January 30, 2013 Why not just specify path to the executable? Also, are you sure that PATH isn't available? I can easily get values for HOME and other variables from bash scripts.
CarlosNZ Posted January 30, 2013 Posted January 30, 2013 There is a workflow called "Background command" in the Alfred repository. Have a look at their script and see how they've dealt with this issue.
phyllisstein Posted January 30, 2013 Posted January 30, 2013 This could be one of those cases in which the PATH that Terminal sees isn't seen by GUI apps. (There's a better way to explain that than "sees," but it's eluding me.) I know that my LaTeX installation adds something to PATH that wasn't picked up in the GUI till I followed the instructions here. Whether that means Andrew should add this I leave to the judgment of others: it's a well-known problem with OS X, but by dint of its well-known-ness, the solution is, too.
ctwise Posted January 30, 2013 Author Posted January 30, 2013 Why not just specify path to the executable? Also, are you sure that PATH isn't available? I can easily get values for HOME and other variables from bash scripts. In this specific example the idea would be to offer suggestions, e.g., 'run mount' would give you the '/sbin/mount' command, but 'run <some script in some other bin directory>' would give me that option. If I dump the PATH from a script in Alfred it's not the full path set by .bashrc, indicating it's not running a login shell (which it shouldn't by default).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now