Does anyone know why after the first iteration I am out of the while loop here ? It used to work like yesterday!! (Same input file containing many lines, no new-lines)
#!/bin/sh
FLAGS_IN=MY_TEXT_FILE_CONTAINING_LOTS_OF_LINE
while read BENCHMARK DATASET CF
do
echo "$BENCHMARK"
echo "$DATASET"
echo "$CF"
N=$((N + 1))
cd $tmp
echo "**********************************************************"
GCC_OPT="-O3"
OPT_FLAGS=$CF
###### do sth
tmp=$PWD
done < $FLAGS_IN
exit 0
debugging, I am sure the scripts work till the end of the loop pretty fine.
tmpwill the evaluate as acdcmd without an argument, and send your script to you home dir. You don't include in your code anything liketmp=/tmp/dirso we can't be sure what is happening. Why do you need acd $tmpafter reading each line? Otherwise, if it used to work and it doesn't work today, AND if you really didn't make any changes to the script, or ftp it from MSWindows to Linux, then it must be your data file. Use a text editor with a binary mode to see what is after the first line. Good luck.tmpsomewhere in the begining of while cuz inside I am moving around some directories, that's why at the end I would like to go back where I was