Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!convex!mic!ernest!shibaya!afc From: afc@shibaya.lonestar.org (Augustine Cano) Newsgroups: comp.unix.shell Subject: How to read sequentially from a file in SH (not KSH) Message-ID: <1991Apr27.012336.2732@shibaya.lonestar.org> Date: 27 Apr 91 01:23:36 GMT Organization: Multidisciplinary Designs Unlimited Lines: 24 KSH can handle reading from a file sequentially with no problem if one uses the following statements: exec 3< $FILENAME while read -u3 VAR1 VAR2; do print $VAR1 $VAR2 done SH does not support this (at least not the one I have). I have tried: while read VAR1 VAR2 < $FILENAME; do echo $VAR1 $VAR2 done but I keep reading the first line in the file over and over. Nothing in the manual page seems to be usable in this situation. How is this done under SH? Is it possible? Using ksh is not an option since the machine I need to run this on does not have it. Thanks in advance. I'll summarize e-mailed responses. -- Augustine Cano INTERNET: afc@shibaya.lonestar.org UUCP: ...!{ernest,egsner}!shibaya!afc