I have a script to do a couple simple but repetitive commands on files that are provided to us. One of the things is to get rid of the line feeds. This is the section that is causing problems, i even cut this section into its own file to make sure nothing else was affecting it.
#!/usr/bin/bash
ls File_Name_* |while read FN
do
sed 's/^M//' ${FN} > ${FN}.tmp ### the ^M is input with ^v^M
mv ${FN}.tmp ${FN}
done
It works fine and shows up fine in vi. but if i try to cat or more the file it shows
#!/usr/bin/bash
ls File_Name_* |while read FN
do
//' ${FN} > ${FN}.tmp/
mv ${FN}.tmp ${FN}
done
Oh if i usr /usr/xpg4/bin/more it shows it all except the ^M itself:
#!/usr/bin/bash
ls File_Name_* |while read FN
do
sed 's///' ${FN} > ${FN}.tmp ### the ^M is input with ^v^M
mv ${FN}.tmp ${FN}
done
Can someone explain this. The ^M is affecting the display of the file and i have never seen this before. This is on a Solaris 9 system.