Wednesday, August 2, 2017

Remove "carriage return" from file under UNIX

Review a file with special characters: 
cat -v /home/user/example.sh

Remove carriage return(CR) from file:
perl -p -i -e "s/\r//g" /home/user/example.sh

Important links:
https://stackoverflow.com/questions/18125667/not-found-no-such-file-or-directory-error-even-though-the-file-present-in-tha

Best Regards,