The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
get last characters in ksh meghana Shell Programming and Scripting 5 04-11-2008 01:11 PM
how to get first two characters from a word sachin.gangadha UNIX for Dummies Questions & Answers 4 12-06-2007 01:57 PM
replacing characters palmer18 UNIX for Dummies Questions & Answers 3 08-20-2007 06:58 AM
Add few characters er_aparna Shell Programming and Scripting 7 08-17-2006 07:53 AM
characters ô ö à é è Castelior Shell Programming and Scripting 1 04-19-2006 07:52 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-14-2006
Registered User
 

Join Date: Feb 2006
Location: Mumbai, India
Posts: 24
Contol M (^M) characters

Is there a way to recursively find scripts/files with ^M characters embedded in them

Usually the case is when a file is saved on unix but in dos/windows format it ends up have ^M characters at the end of each line.

Please let me know if there is a way to recursively find them.
Reply With Quote
Forum Sponsor
  #2  
Old 02-14-2006
Registered User
 

Join Date: May 2002
Posts: 62
Quote:
Originally Posted by Anubhav
Is there a way to recursively find scripts/files with ^M characters embedded in them

Usually the case is when a file is saved on unix but in dos/windows format it ends up have ^M characters at the end of each line.

Please let me know if there is a way to recursively find them.
Are you trying to remove them so that windows may read the file?

If you are, I would try:

xtod unixfile > windowsfile

Georgio
Reply With Quote
  #3  
Old 02-15-2006
Registered User
 

Join Date: Jul 2005
Posts: 67
try command dos2unix <filename> or unix2dos<filename>
Reply With Quote
  #4  
Old 02-15-2006
Registered User
 

Join Date: Feb 2006
Location: Southern England
Posts: 102
grep -l ^M *

type:
grep -l <ctrl-V><ctrl-M> *
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 10:18 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0