I hope this belongs in the "Programming" section (I'm new to LQ)....
I am a junior FreeBSD sysadmin and really like csh (standard shell on our FreeBSD machines). Sometimes the need for a while loop arises. These last couple of weeks I have been forced to do certain stuff in bourne shell because my csh skills are not op to the task. This is a bit cumbersome and frustrating: how difficult can csh's while implementation be ?
I've searched a lot of websites (including LQ) but haven't been able to translate a simple while loop into correct csh syntax. Csh seems a bit elusive
file "kwaak.txt" contains :
I'm able to do stuff for each entry in bourne by issuing:
cat kwaak.txt | while read example ; do echo "Displaying $example" ; done
If I issue the same command while in csh things obviously don't work because of the different syntax that is required by csh. After asking several coworkers and abusing google for quite some time I haven't been able to find the correct csh syntax.
My solution now is to enter a traditional bourne shell and do it there or to write a script that does it; both are not ideal.
Perhaps somebody on this forum can help out?
Any help would be greatly appreciated!