Bash scripts do not echo commands
I have a bash script named ztest that looks like this:
--------------- #!/bin/bash ls -lat --------------- On server A it works fine, and I get a directory listing. On server B I get nothing. As though the script did not execute! However, I modified the script: --------------- #!/bin/bash ls -lat $1 >zresult --------------- When I execute the following: #./ztest #cat zresult I see the directory. And if I execute the following: #./ztest /etc/init.d/ #cat zresult I see the /etc/init.d/ directory. Bottom line: The bash script is executing. But I am not getting/seeing any output from the script. I have tried echo commands, >stdout, etc. but no such luck! I am ssh'd into the server using PuTTY. But I have no idea if this is a system configuration issue? A PuTTY issue? Some other issue? Any ideas? Sean McCoy sean@responsivedata.com |
Are you sure ztest is executable on server b.
chmod +x ztest |
Yes.
chmod 0755 ztest And per my post, when the script directs output to a file, I can see the results in that file. So I know the script is executing. I just cannot see any of my commands being echoed. |
I think that's something about FD(file descriptor). That means something about redirection in server b is changed because the default stdout device is Screen, but now it's obvious not. But unfortunately I didnot know which place to do this kinda changes. I am searching for it now.
|
All times are GMT -5. The time now is 04:40 PM. |