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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Auto copy for files from folder to folder upon instant writing Bashar UNIX for Advanced & Expert Users 2 08-21-2008 03:44 PM
Replace folder in all hosting accounts jimmack UNIX for Dummies Questions & Answers 1 04-20-2008 02:25 AM
ftp a files from a folder dineshr85 Shell Programming and Scripting 2 10-08-2007 02:51 AM
Search For Control M characters in files Mohammed Shell Programming and Scripting 4 10-06-2006 01:40 PM
how to replace control characters using sed? hillxy Shell Programming and Scripting 5 10-16-2003 11:12 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-01-2008
telecomics telecomics is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 6
Recursive Control M

For each file recursively I used -

find / -name "*" | xargs perl -p -i -e 's/^M//g' *

This will find all files "*" starting from the root and on each file having ^M will perform a cleanup globally.


But there is a PROBLEM with this command . It changed all my LIBRABRIES since i used -- perl -p -i -e 's/^M//g' *

Is there some way to revert this thing from my libraries . Does any revert command exits for the Control M in libraries. I believe my libraries are corrupted now.

Regards,
Telecomics
  #2 (permalink)  
Old 09-01-2008
dennis.jacob dennis.jacob is offline Forum Advisor  
dj - the student
  
 

Join Date: Feb 2007
Location: Singapore/Bangalore/Cochin
Posts: 610
Quote:
Originally Posted by telecomics View Post
For each file recursively I used -

find / -name "*" | xargs perl -p -i -e 's/^M//g' *

This will find all files "*" starting from the root and on each file having ^M will perform a cleanup globally.


But there is a PROBLEM with this command . It changed all my LIBRABRIES since i used -- perl -p -i -e 's/^M//g' *

Is there some way to revert this thing from my libraries . Does any revert command exits for the Control M in libraries. I believe my libraries are corrupted now.

Regards,
Telecomics

Am afraid no options are available, except if you have backups....
  #3 (permalink)  
Old 09-02-2008
vamsi.coe vamsi.coe is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 17
hmm

control M characters are mess.. yes.. when copied from windows..
i have a simpler way to do this

dos2unix file1 >file2
mv file2 file1


tell me if it works for you
  #4 (permalink)  
Old 06-23-2007
padpa padpa is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 11
Hi Shell Life(sorry i don't know your name)

could you please tell me how this works in a recursive way
Closed Thread

Bookmarks

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:47 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0