Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Replace ^M, ^H, ^G Characters Unix
Name: Shanthi Date: July 18, 2006 at 07:08:56 Pacific OS: Unix CPU/Ram: 1GB Product: Sun
Comment:
Hi I am using the "script" command in unix to log all the activities performed by users. However, the file generated has a lot of ^M, ^H, ^G characters in it. I would like to know I can suppress these? Or eliminate these using some command.
Name: nails Date: July 21, 2006 at 20:42:41 Pacific
Reply:
One way is to use the tr command to delete the control characters using octal values. Since the octal values of ^M, ^H, ^G are 015, 010, 007 respectively, this command deletes the 3 control characters:
tr -d '\015\010\007' < data.file > new.data.file
If you need the value of other control characters, but do not have an ASCII chart, use this method to deterine the value: from within vi and in an edit mode, press control-v and then press the control character. Save the file and perform an od -b command on the file. This displays the octal value.
Summary: i'm needing help making unix accounts i'm a student and i've found out how to make regular accounts in unix but i need to use this page to go by.: --------------- Create a script to create user accoun...
Summary: Hi all, I'm working on Exceed (unix machine) from Windows. With a grep command on a file I build a new text file in UNIX in wich every line is of type: X:Y;Z;K;A,B\n I have to fill an Oracle db table...
Summary: i'm like in awe of Jean-Pierre's solution. I had to man, info and browse to understand it. i'd like to try to explain so I will really learn it. The \ are shell escapes (except \1),so consider sed 's...