Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.
It's been a while since I was shell scripting regularly, but I thought that when the 'for' command was using a text files, it would loop through, 1 line at a time.
I've got it to read the input file, but it's reading the whole file, instead of 1 line at a time ....
Is this is a limitation of UnxUtils? Or is it my poor code?
Input file (test.txt) like this:
line1entry1 line1entry2 line1entry3
line2entry1 line2entry2 line2entry3
line3entry1 line3entry2 line3entry3
Running script (test.sh) like this:
echo INPUTFILE = $INPUTFILE
for ENTRY in `cat $INPUTFILE`
echo ENTRY = $ENTRY
INPUTFILE = D:\temp\test.txt
ENTRY = line1entry1
ENTRY = line1entry2
ENTRY = line1entry3
ENTRY = line2entry1
ENTRY = line2entry2
ENTRY = line2entry3
ENTRY = line3entry1
ENTRY = line3entry2
ENTRY = line3entry3