The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
How To replace Control-M in all files in a folder
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
How To replace Control-M in all files in a folder
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
7
(
permalink
)
06-23-2007
blowtorch
Supporter
Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Adapting aigles' code
Code:
for file in $(find /path/to/dir -type f); do tr -d '\r' <$file >temp.$$ && mv temp.$$ $file done
Last edited by blowtorch; 06-23-2007 at
02:10 AM
.. Reason: fix broken code tags
blowtorch
View Public Profile
Find all posts by blowtorch
Find blowtorch's past nominations received
Find blowtorch's present nominations given