Reading a file more than once in a shell script
From: Bernie (bpw4h_at_yahoo.com)
Date: 07/27/04
- Next message: William Park: "Re: Reading a file more than once in a shell script"
- Previous message: Chris F.A. Johnson: "Re: Line Count of Source Files in a Package"
- Next in thread: William Park: "Re: Reading a file more than once in a shell script"
- Reply: William Park: "Re: Reading a file more than once in a shell script"
- Reply: soumen: "Re: Reading a file more than once in a shell script"
- Reply: Chris F.A. Johnson: "Re: Reading a file more than once in a shell script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 26 Jul 2004 15:58:09 -0700
Hi,
I was wondering if there was a way to read in a file more than once in
a shell script. I'm not sure how else to explain it, so it might be
easier to understand if you look at the script:
for a in 1 2 3 4
do
while read -r INPUT_LINE
do
<commands>
done < ${SOURCE_FILE}
done
This seems to be giving me some problems that I can quite figure out
how to solve. After the first read through of the SOURCE_FILE, I
basically want to start over and read it again. Is there a way to
"reset" the SOURCE_FILE? Running the above script gives me one good
output, and then the rest of the output is incorrect.
Thanks.
Bernie
- Next message: William Park: "Re: Reading a file more than once in a shell script"
- Previous message: Chris F.A. Johnson: "Re: Line Count of Source Files in a Package"
- Next in thread: William Park: "Re: Reading a file more than once in a shell script"
- Reply: William Park: "Re: Reading a file more than once in a shell script"
- Reply: soumen: "Re: Reading a file more than once in a shell script"
- Reply: Chris F.A. Johnson: "Re: Reading a file more than once in a shell script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|