new scripts won't run
I'm on a RedHat Linux box (2.4.21-27.0.2.EL) and for some reason certain scripts just won't run (I get a 'command not found') even when I give an explicit path to the file.
The file is located in a directory with other scripts that run just fine. It's got the same permissions as the other scripts and is owned by the same user/group as the other scripts. Oddly enough, if for example I type "tcsh -v x.sh", then the script does appear to run. I do, however, see "command not found" unexpectly mingled in the output. What is going on??? Here's the the content of a script that I can't get to run normally, and the output I get when I invoke it as an arg to 'tcsh': ========== 'x.sh' script content ========== #!/bin/tcsh set release= if ("${release}" != "") set isRelease=1 echo yaba daba dooo endif echo testing 1 2 3 ========== end conent ========== ========== start output ========== [dfaison@jill admin]$ tcsh -v x.sh set release= if ( "${release}" != "" ) : Command not found. set isRelease=1 echo yaba daba dooo yaba daba dooo endif : Command not found. echo testing 1 2 3 testing 1 2 3 [dfaison@jill admin]$ cat x.sh #!/bin/tcsh set release= if ("${release}" != "") set isRelease=1 echo yaba daba dooo endif echo testing 1 2 3 ========== end output ========== |
Hi,
Shouldn't this: #!/bin/tcsh be #!/usr/bin/tcsh Hope this helps. |
thanks but that isn't it...
the system I'm on really does have 'tcsh' located in '/bin' directly off of the root.
|
Hi again,
Take a look at your if statement, you are missing the 'then' part. if ("${release}" != "") then I should have seen that the first time around............ Anyway, hope this helps. |
found out the problem!!!
Thanks for the help but an associate of mine and I tracked down the problem.
Turns out the root of the problem was that I originally created the text file I was working with on a Windows machine. Once I ran 'dos2unix' on it, mysterious 'command not found' problems went away. |
All times are GMT -5. The time now is 06:30 AM. |