I am working on a script that pulls data from a csv file, manipulates the data, and then asks the user if the changes are correct. The problem is you can't seem to execute a read command inside a while loop that is reading a file. A test script is included below, note a in file will need to be created granted it isn't really used. This is just an excerpt from a larger script I am working on. I'm recoding it to use arrays which seems to work, but would like to know if there is any way around this? I've been reading through several bash guides, and the man pages for read and haven't found a answer. Thanks in advance.
#!/bin/bash
#########
file="./in.csv"
OLDIFS=$IFS
IFS=","
#########
while read custdir custuser
do
echo "Reading within the loop"
read what
echo $what
done < $file
IFS=$OLDIFS
awkto be a better choice for what you're trying to do.