home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / shell / 5043 < prev    next >
Encoding:
Text File  |  1992-12-11  |  1.0 KB  |  30 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!cs.utexas.edu!wupost!crcnis1.unl.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!usenet.ucs.indiana.edu!shutton
  3. From: shutton@fokker.union.indiana.edu (Scott K. Hutton)
  4. Subject: Re: Reading a line from a file in Bourne
  5. In-Reply-To: shutton@fokker.union.indiana.edu's message of Fri, 11 Dec 1992 16:29:20 GMT
  6. Message-ID: <SHUTTON.92Dec11223107@fokker.union.indiana.edu>
  7. Sender: news@usenet.ucs.indiana.edu (USENET News System)
  8. Nntp-Posting-Host: fokker.union.indiana.edu
  9. Organization: /nfs/bronze/usr2/shutton/.organization
  10. References: <SHUTTON.92Dec11112920@fokker.union.indiana.edu>
  11. Distribution: usa
  12. Date: Sat, 12 Dec 1992 03:31:07 GMT
  13. Lines: 15
  14.  
  15. I've received a lot of good advice, both through e-mail and followups.
  16. The bottom line (while I did receive lots of  innovative solutions) is
  17. to do something akin to the following:
  18.  
  19. #!/bin/sh
  20. cat myfile |
  21. while read LINE
  22. do
  23.  echo a full line: $LINE
  24. done
  25.  
  26. "read"  apparently has a  significant return value--major goof  on  my
  27. part for failing to check this.
  28.  
  29. -S
  30.