Sed question
From: Robert Gease (robert_gease_at_yahoo.com)
Date: 12/18/03
- Next message: Stephane CHAZELAS: "Re: How to get the title of a CDROM?"
- Previous message: Pawel Banys: "Re: how to catch an exit message from a program"
- Next in thread: Ed Morton: "Re: Sed question"
- Reply: Ed Morton: "Re: Sed question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 18 Dec 2003 08:57:53 -0800
I tested something I ripped from the O'Reilly book..
If I run as a script. ie sed -f flip flip.text
flip:
'/1/{
h
d
}
/2/{
G
}'
flip.text:
1
2
11
22
111
222
it works fine and flips the lines containing 1 and 2, but
sed '/1/{h;d;};/2/{G;}' flip.text
Doesn't work. ie. replacing new lines with ";".
But if I add <CTRL-J> for ";" it works.
sed '/1/{^Jh^Jd^J}^J/2/{^JG^J}' flip.text
Anybody know whats going on.. since I often see sed
scripts that I want to transfer them to the command line.
Thanks
Rob
- Next message: Stephane CHAZELAS: "Re: How to get the title of a CDROM?"
- Previous message: Pawel Banys: "Re: how to catch an exit message from a program"
- Next in thread: Ed Morton: "Re: Sed question"
- Reply: Ed Morton: "Re: Sed question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|