Re: tcsh read loop
From: Bruce Barnett (spamhater103+U040912213736_at_grymoire.com)
Date: 09/13/04
- Next message: Andrew Gabriel: "Re: Motif"
- Previous message: Alan Connor: "Re: Newbie - list of parameters to be passed to a command"
- In reply to: Christopher W Aiken: "tcsh read loop"
- Next in thread: Christopher W Aiken: "Re: tcsh read loop"
- Reply: Christopher W Aiken: "Re: tcsh read loop"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 13 Sep 2004 01:39:08 GMT
Christopher W Aiken <chris@nospam.net> writes:
> In sh/bash I can use a loop like this to process text lines:
>
> while read line
> do
> echo $line
> ...
> ...
> ...
> done < some_text_file.txt
>
>
> Can this type of loop, that reads a complete line from a file, be done in
> csh/tcsh? How?
Only if the file you are reading is STDIN.
http://www.grymoire.com/Unix/CshTop10.txt - Top 10 reasons not to use the C shell.
This is reason #5.
You have to split this script into smaller scripts, and change STDIN.
-- Sending unsolicited commercial e-mail to this account incurs a fee of $500 per message, and acknowledges the legality of this contract.
- Next message: Andrew Gabriel: "Re: Motif"
- Previous message: Alan Connor: "Re: Newbie - list of parameters to be passed to a command"
- In reply to: Christopher W Aiken: "tcsh read loop"
- Next in thread: Christopher W Aiken: "Re: tcsh read loop"
- Reply: Christopher W Aiken: "Re: tcsh read loop"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|