Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am centos 5.4 user and I can't run shell script outside its directry i.e my script is located:


it will run as


but not as


it is 755 chmod, why its like that ?

cheers, /Marcin

share|improve this question
What is the error message you get when you run /me/ ? – Iain Oct 19 '10 at 12:16
nothing, just really does nothing – Marcin Oct 19 '10 at 12:23
up vote 0 down vote accepted

What error does it give you?

Did you write it to be run from anywhere, or inside it does it call programs by relative path such as 'program' instead of '/me/program' and it now cannot find them?

share|improve this answer
its just echo program, really dummy stuff for testing purposes, then there is no dependencies at all – Marcin Oct 19 '10 at 12:15
OK, got it, as you said, I have realized that I am running something what requires proper path, anyway, all fixed. – Marcin Oct 19 '10 at 12:25

Run your shell script as bash -x /me/ and see what's going wrong. There's no overall technical reason a script can't work outside your directory, so it's got to be something you're running that expects $CWD to be /me.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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