$ ex -sc $'%s/\r$//e|x' file Perfectly works from the terminal from but when I try to run it with
.sh script it simply ignores the lines after
$ rm ~/Desktop/projectautomate/finalutf81.csv $ rm ~/Desktop/projectautomate/finalutf8.csv $ cat ~/Desktop/projectautomate/headersutf8.csv ~/Desktop/projectautomate/upload.csv >> ~/Desktop/projectautomate/finalutf8.csv $ iconv -f utf-16 -t utf-8 ~/Desktop/projectautomate/finalutf8.csv -o ~/Desktop/projectautomate/finalutf81.csv -c $ ex -sc $'%s/\r$//e|x' ~/Desktop/projectautomate/finalutf81.csv
Every thing works but not the last line of command. I am basically trying to remove the CRLF (end line control characters) from the the file finalutf8.csv . Some detailed explanations would be appreciated. If not clear as English is my second language, I would try to explain it.