1

I have a relatively simple question that I cant figure out and I cant figure out the right search query to find the info I need on google so I thought I would ask the collective.

In short:

cd /var/www/config
./deploy.sh - works!

but

./var/www/config/deploy.sh

doesnt :(

deploy.sh calls another bash script and it seems that the called script cant find the libs it needs because it searches relative to where it was called from which in this case would be / instead of /var/www as it expects.

I'm trying to call this from a capistrano script therefore need to find a way to call it without having to cd first. Does anyone know a simple way to achieve this?

EDIT: Thanks for your quick suggestions, its still playing up. deploy.sh calls another bash file called sake. I have uploaded a copy here http://tinypaste.com/25fc8

Cheers guys!

1

3 Answers 3

1

Don't put a . (period) in front of your command. Just use:

$ /var/www/config/deploy.sh
1
  • Hey that makes sense, thanks for your quick help! Im still getting the error "Can't find ./sapphire/cli-script.php or ./cli-script.php" - The bash script I am calling is still trying to search for the libs it needs using relative addressing.
    – Nick
    Dec 15, 2010 at 21:56
0

You can also wrap it too so you can return to existing dir, sometimes proggies like to pick up the PWD in which to work so might be worth setting it explicitly:

( cd /var/www/config/ && ./deploy.sh )

0

If you want to remain where you are after the command is done:

(cd /var/www/config; ./deploy.sh)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.