It is currently Tue, 07 Dec 2021 03:43:33 GMT

Author Message
 read a file line by line in csh script
Hi !

Everything is in the subject !

If would like to do the equivalent of a getline or a while read in sh. Is
it possible in csh ?


 Mon, 16 May 2005 17:45:25 GMT   
 read a file line by line in csh script

 ok I found it :

cat toto.csh:
#!/bin/csh -f

while( 1 )
        set truc = "$<"
        echo "-----> $truc"

to be used with

./toto.csh < .tcshrc
-----> #!/bin/tcsh
-----> #Fichier .tchsrc
-----> setenv SHELL /bin/tcsh
-----> setenv TZ MET-1METDST
-----> set autolist
-----> set notify
-----> set listjobs=long
-----> set history=50

etc etc.

 Mon, 16 May 2005 17:52:11 GMT   
 read a file line by line in csh script

Note that it only works with STDIN. You cannot prompt the user's terminal
during this. You cannot do this on a file while processing a pipe.
You cannot specify the file in the middle of the script.

Sending unsolicited commercial e-mail to this account incurs a fee of
$500 per message, and acknowledges the legality of this contract.

 Mon, 16 May 2005 21:01:16 GMT   
   [ 3 post ] 

Similar Threads

1. Reading a script file line by line.

2. ksh script --reading file line by line?

3. How to read line by line in csh

4. read from stdin while reading line by line a file

5. Line-by-Line readin file in csh

6. Read lines of file using csh

7. line by line reading of the lines in list

8. Using read within a loop that parses a file line by line

9. reading files line-be-line?

10. Read a file line after line

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software