To remove ^M characters in UNIX
To get the ^M in unix ( press control+V control+m ) i.e ctrlv & ctrlm on your keyboard(no spaces in between)
do anyone of the following:
dos2unix filename ( not all unix flavors have dos2unix by default)
or
sed 's/^M//g' ${INPUT_FILE} > tmp.txt
mv tmp.txt ${INPUT_FILE}
or
tr -d "\15" < ${INPUT_FILE} > tmp.txt;
mv tmp.txt ${INPUT_FILE}
or
perl -p -i -e 's/^M//g' ${INPUT_FILE}
or
multiple files in a directory
This will remove all the ^M from each file.
perl -p -i -e 's/^M//g' *
Experience: is what you get soon after you need it.
Experience: is what you get soon after you need it.
My Cloud Certifications:
Certified Kubernetes Administrator (CKA)
Cloud Certified Security Professional (ISC2)
CyberSecurity Certified Professional (ISC2)
AWS Certified Solutions Architect Associate
Azure Certified Architect Expert
Azure Certified Architect
Azure Certified Administrator
Oracle Cloud Infrastructure 2018 Certified Architect Associate.
Oracle Cloud Infrastructure Classic 2018 Certified Architect Associate.
Oracle Database Cloud Administrator Certified Professional.
Oracle Database Cloud Service Operations Certified Associate.