Variable syntax problem for SunOS 5.8 using C Shell
I'm getting the error "Variable syntax" after running the script
test.csh with the following contents:
#!/bin/csh -f
set PSDE_ARG=$argv
echo $PSDE_ARG | grep -i "sdk" > /dev/null
echo $?
The above is supposed to look for keyword sdk in the input of the
script, for example
"test.csh hellosdk"
should echo 0 if keyword sdk is found. I was able to run the exact same
script successfully on the C shell of SuSE Linux 9.3 and Red Hat
Enterprise Linux WS release 4. I am aware that C shell is not a very
good shell and I know of the top 10 reasons not to use it but it still
has to be supported. Any ideas?
Thierry
.
Relevant Pages
- SUMMARY: Annoying Shell/Terminal Problem
... that a startup script was set to trapINT. ... # echo howdy^Cecho doody ... The ^C canceled the first echo, but it doesn't cause the shell ... when I run those echo commands from the shell. ... (SunManagers) - Re: take file name from command line arguement and write to file
... the Bourne Again Shell. ... > echo $a ... splitting, parameter substitutions etc. ... script and first sees the eval command, at first it behaves the usual ... (comp.unix.shell) - Re: help regarding shell script to find out if a directory exists at a given path
... echo "found directory at the given path.." ... Every line I write is potentially a line in a script. ... resulting program will be easier to maintain than a bash script. ... shell is more than powerful enough. ... (comp.unix.programmer) - Re: Mutiple fork return status
... from a script you can obtain the exit code of any background process you spawned with the "wait" builtin, it will return the process' exit code as its own or 127 in case of errors try this sequence of commands, they are picked from memory but should be correct: ... # echo $? ... if you issue a "wait" while the process you are inquiring about is still running, the script will pause until the process in question exits by itself or is terminated. ... you can get more info about the "wait" builtin in the docs for the shell of your choice. ... (comp.os.linux.misc) - Re: Very Simple script driving me nuts!
... > from shell scripting over the years, for the most part been working ... > 5 echo ... > $* so I don't have type any surrounding quotes when I use my script, ... echo -n "CMD: $*" ... (comp.unix.shell) |
|