I need some help.I try to write csh script and I need to iterate through all files in current dir and do some tasks, so I wrote this:
#!/bin/csh
foreach f ($(ls)) if( some condtions) echo "$f"
endbut every time I try to run this, I get: Illegal name error.
1 Answer
This seems to not be the whole script. The if( some condtions) won't run because some condtions is being interpreted as an unknown value, and not true or false.
Csh seems to be unfavorable by many, and I personally recommend bash.
2