03-27-2005 06:32 PM
I used to read lines from a LOGfile using ksh "
while read line
done < $LOGFILE
but when try using csh, it gives me error "
while: expression syntax".. does this means it doesnt work for csh?.. is there an alternative script I can use to produce the same thing?
03-27-2005 07:03 PM
another and, as far as I remember, syntax for "while"
loop in csh is different than that in ksh. (I don't think
there is a "do" after "while" in csh). You should
really take a look at csh(1) manpage.
03-28-2005 12:25 PM
there (as last time I used csh was atleast 10
years back :-).
But I fail to understand why are you trying to write
this in csh. "ksh" and "sh" are probably the most
popular shells in unix right now and I personally
would not spend any time learning csh. But, ofcourse,
you might have your compelling reason for this. In
that case, someone else in this forum should be
able to help you.
03-28-2005 01:47 PM
Now the question: why use a very limited and incompatible shell when your csh users can run the exact same script? The first line (#!/usr/bin/ksh) tells the csh shell to use a different interpreter. This is why a csh, ksh or any other Unix shell user can run a perl script or any other interpreter without changing the current shell. As long as your scripts start with #!/usr/bin.... then you can write your scripts in any shell language that's available on your system.
This link may be helpful: http://www.maths.leeds.ac.uk/~read/csh.html
Note that references to the Bourne shell should be replaced with "POSIX shells including ksh, HP-UX sh, bash, etc)
03-28-2005 02:26 PM
03-28-2005 04:25 PM
Just say NO! :-).
Yeah I know, easy for me to say, but seriously, for your own sanity please try to get 'them' to articulate why csh is required.
My other 'shoot from the hip' reaction would be: for lexical work like trouncing through a log, use a lexxial tool like AWK or PERL.
>> .. Apparently there really isnt much info on csh anywhere...
For good reason... :-).
03-28-2005 04:35 PM
What can I say..
Well the reason being that I am not able to decipher the following in csh..
"alias CMD1 /usr/bin/cmd1
set planpath = "/users/home1/plan_path"
set tkind = 0x103
alias START 'onintr -; CMD1 path $planpath \!*; CMD1 start \!* $tkind;onintr TEXIT; CMD1 init'
Can it be translated to ksh, if so how??
this is really alien to me..