Run a specific command from a directory

Posted by Cameron Kilgore on Super User See other posts from Super User or by Cameron Kilgore
Published on 2012-11-21T21:59:14Z Indexed on 2012/11/21 23:02 UTC
Read the original article Hit count: 125

Filed under:

I have a bash script where I need to run an init utility within a directory with a configuration file defined. I don't think it's possible to explicitly tell the utility to run the file as an argument, so what I need to do is go to the directory with the config file, and then run the command. I have some logic in place, but its not working -- the utility never runs. Is there any way I can tell the script to go to this directory, and then run the script?

cd /var/www/testing-dev.example.co
eval "standardprofile"

© Super User or respective owner

Related posts about bash-scripting