Unix Tip #4365- February 22, 2014


SEARCH : Home : Help : Today's Tip

REMOVING CONTROL CHARACTERS


Have you ever faced problem of removing
Control Characters from Multiple Files,

Here is the solution create script file
with following entries,

vi -c "%s/^M//g" -c "wq" junk1.c
vi -c "%s/^M//g" -c "wq" junk2.c
vi -c "%s/^M//g" -c "wq" junk3.c
vi -c "%s/^M//g" -c "wq" junk4.c
vi -c "%s/^M//g" -c "wq" junk5.c
vi -c "%s/^M//g" -c "wq" junk6.c


If the filename of this script file
is "xyz":

#./xyz

This will remove the control characters(^M)
from all the files junk1.c ... junk6.c

To create ^M = Holding the control
press 'v' & 'm'.

To create ^H = Holding the control press
'v' & 'h'.


This tip generously supported by: srikanbn@miel.mot.com



NOTE: All tips provided are USE AT YOUR OWN RISK. Tips are submitted by various unix admins around the globe. UGU suggest you read and test each tip in a non-volitile environment before placing into production.


LAST 5 TIPS
4364 - GZIP ZNEW AND COMPRESS
4363 - QUICKLY FINDING SUN MEMORY
4362 - VALUE OF LAST PARAMETER
4361 - INSERT A LINE
4360 - FINDING CORE FILES


I want to SUBSCRIBE and get a UGU Tip everyday.
I want to UNSUBSCRIBE and NOT get a UGU Tip everyday.

If you have a UNIX TIP let us know, we just may use it:
(All tips become the property of the Unix Guru Universe)
Email Address:

Yes, email me a Hot Unix Tip everday.

Enter Hot Unix Tip (optional):

Yes, I will support this tip

Captcha (not case sensitive):


Please enter the above letters:


HOME | Flavors | Admin | Network | Security | S/W | Help | Events | Vendors | Careers | Internet
About | Add Link | Feedback | Search

Copyright © 1994-2005 Unix Guru Universe