[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 563
  • Last Modified:

how to remove ^M in script files?

how to remove ^M character script files, the ^M character was appended while transferring the files in Binary mode instead of ASCII mode. So i want to remove this special character, how to remove this special character through command line of unix?
0
umesh4exp
Asked:
umesh4exp
  • 2
2 Solutions
 
omarfaridCommented:
try

dos2unix origfile newfile
0
 
umesh4expAuthor Commented:
dos2unix is not installed
0
 
umesh4expAuthor Commented:
i want to remove ^M character in the files which was FTP ed in binary mode using standard utilities provided.
0
 
woolmilkporcCommented:
Hi,

sed 's/\r$//' [filename] > [filename].tmpmv [filename].tmp [filename]   # after verifying the results


HTH
wmp
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now