All of the sudden, today, when I type csh the prompt does not change to %.
And, I’m trying to run a a csh script.
I wrote a shell script and it worked fine yesterday.
The next time I log, I run the script “./rm_csh .” and get:
Code:
-'nknown option: `-
Usage: csh [ -bcdefilmnqstvVxX ] [ argument ... ]
When I run the
Code:
script “csh –f rm_csh .”, I get:
foreach: Words not parenthesized.
I can’t figure out what’s going on. The script works fine one day, the next day the line #!/bin/csh –f is not recognized.
This is the whole rm_csh script:
Code:
Code:
#!/bin/csh – /*** fails on this line as ./rm_csh
set todayDate=`date "+%m%d%Y"`
set thePath=${1}
foreach FILE (`ls ${thePath}/*_*.jpg`)
set fileDate = `echo ${FILE} | cut -f2 -d"_" | cut -f1 -d"."`
if ("${fileDate}" != "${todayDate}") then
rm -rf ${FILE}
endif
end I'm on a redhat linux web server.