Using dos2unix and attaching it to a while loop
Mon Apr 9 07:24:00 GMT 2007

I am dealing with DOS text files and need to output DOS text files. This scenario is not about
converting a file in DOS format to UNIX format; or read a file line by line. It relates to using
Unix commands and manipulating a dos file and staying in a dos format

How do you read each line in a while loop? 
Do I need to change the IFS or use dos2unix? 
How does a Bash script output a DOS text file?

I found dos2unix, but I do not know how to properly implement it. The following Bash code is a
work-in- progress. Please let me know if a more efficient approach exists. 

while read line
		echo "LINE -> $line"
		echo "i -> $i"
		MP3[i++]=$(awk '/^.*\.mp3/ { print $1}')
		CRC[i++]=$(awk '/^.*\.mp3/ { print $3}')
		echo "MP3[i] -> $MP3[i]"
		echo "CRC[i] -> $CRC[i]"
	done < <(dos2unix "$FILE")

 #do some stuff  then
unix2dos "$FILE"

The cygwin console returns the following error. My syntax is not correct. line 132: syntax error near unexpected token `<' line 132: `          done < <
(dos2unix "$FILE")'

Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list