[HPADM] SUMMARY vi question
From: Hustert Klaus-CKH035 (Klaus.Hustert@motorola.com)
Date: 04/24/03
- Previous message: Stephane.Lachapelle@natrel.ca: "[HPADM] packages cron and lpsched in MC/SG"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: Hustert Klaus-CKH035 <Klaus.Hustert@motorola.com> To: "HPADM (hpux-admin@dutchworks.nl)" <hpux-admin@DutchWorks.nl> Date: Thu, 24 Apr 2003 15:51:43 +0200
Hi again,
Thanks a lot who has responed:
For the actual script I will use the ^v^L (ctrl v and ctrl L) solution.
In future I will using sed or ed to get more speed.
Here the suggestions:
################################################################################################
Note that ^M is your guide, ^ (that is ^ and a space) is an ascii-readable view to value 0. ^A is for 1, ^B is for 2, ^L is for 12 and so on.
If you know the <ctrl>v followed by a non-readable ascii code, you most likely once accidently hit <ctrl>vv and view at the prompt, it shows ^V !!
THere you have it, to get ^L, just type <ctrl>v<ctrl>l. (and so you can also get ^M with <ctrl>v<ctrl>m)....
The origin is the other way round: ^V is shorthand for <ctrl>v.
Thanks to Corné, Harm and Cooper (excuse me when I am using the last name, I dunno it better ;-))
################################################################################################
If you've got Perl installed, you can do this from the command line:
$ perl -pi -e 's/\014//g' myfile
Thanks to Christopher
################################################################################################
sed -e 's/Ctrl-V Cr//g' -e 's/Ctrl-V Ctrl-L//g' File > file.out
Thanks to Jack, Brett, Stuart
Original question:
Hi folks,
I have a data stream and have to replace the form feed (^L; ASCII 12) with another symbol. My script looks like:
vi xxx <<EOF1
:%s/^M//g # I know I have to press ctrl+v in insert mode
# and than the carrage return key to get the ^M
:%s/^L//g # ,but how can I get the ^L ???
:wq!
EOF1
Thanks in advance for advice.
Klaus
--
---> Please post QUESTIONS and SUMMARIES only!! <---
To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
Name: hpux-admin@dutchworks.nl Owner: owner-hpux-admin@dutchworks.nl
Archives: ftp.dutchworks.nl:/pub/digests/hpux-admin (FTP, browse only)
http://www.dutchworks.nl/htbin/hpsysadmin (Web, browse & search)
--
---> Please post QUESTIONS and SUMMARIES only!! <---
To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
Name: hpux-admin@dutchworks.nl Owner: owner-hpux-admin@dutchworks.nl
Archives: ftp.dutchworks.nl:/pub/digests/hpux-admin (FTP, browse only)
http://www.dutchworks.nl/htbin/hpsysadmin (Web, browse & search)
- Previous message: Stephane.Lachapelle@natrel.ca: "[HPADM] packages cron and lpsched in MC/SG"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|