It is currently Tue, 07 Dec 2021 02:13:30 GMT



 
Author Message
 read from stdin while reading line by line a file
while read line ; do
    // I need to read input from the user
    read INPUT
done < file.txt

the problem is that it is not going through "read INPUT"

any workaround?

thanks for all your help. I really appreciate it
matias



 Fri, 20 Oct 2006 02:00:47 GMT   
 read from stdin while reading line by line a file
On 2004-05-02, Matias Woloski wrote:

read INPUT < /dev/tty

--
    Chris F.A. Johnson                  http://cfaj.freeshell.org/shell
    ===================================================================
    My code (if any) in this post is copyright 2004, Chris F.A. Johnson
    and may be copied under the terms of the GNU General Public License



 Fri, 20 Oct 2006 02:34:03 GMT   
 read from stdin while reading line by line a file
In article <c73d0a$hp0k...@ID-148083.news.uni-berlin.de>,
 "Matias Woloski" <wolo...@sion.com> wrote:

exec 3<&0
while read line; do
  read -u 3 INPUT
done < file.txt

or:

while read -u 3 line; do
  read INPUT
done 3< file.txt

If your shell's read command doesn't have the -u option to specify a
file descriptor to read from, change it to:

  read whatever 0<&3

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***



 Fri, 20 Oct 2006 03:21:58 GMT   
 read from stdin while reading line by line a file
-SNIP-

What shell are you using that supports '//' as a comment?  Maybe the c++ shell?

:)

Kevin



 Sat, 21 Oct 2006 00:36:09 GMT   
 
   [ 4 post ] 

Similar Threads

1. line by line reading of the lines in list

2. Reading a script file line by line.

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

4. reading files line-be-line?

5. read a file line by line in csh script

6. Read a file line after line

7. reading line by line from a file

8. reading a file line by line

9. read a file line by line

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


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