bash file direct execution

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi all.

I have a little strange problem.
I created a file called 'test.sh' in the root directory containing:
#!/bin/sh
echo test

When I execute it with '/test.sh' there is no output.
When I source it by executing it with '. /test.sh' the output comes ok.
When I move it to '/root' and execute it with '/root/test.sh' then it works 
perfectly.
When I move it to '/home' and execute it with '/home/test.sh' there is no 
output.

Could someone tell me what I shoud do to make the script run without 
sourcing it with '.' ?
This problem happens only on one CentOS 4 box I have, on the others it works 
perfectly. What am I doing wrong ?
The permissions are 755 on the file itself, and I execute them logged as 
root.

Thanks,
Daniel




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux