bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sed


From: Gary Csaniz
Subject: sed
Date: Wed, 31 Oct 2001 12:38:33 -0800 (PST)

The & special character is not supported?

Here is an example:

# delete duplicate, nonconsecutive lines from a file

sed -n 'G; s/\n/&&/; /^\([ -~]*\n\).*\n\1/d; s/\n//; h; P'

 

Here is a description of what it's supposed to do:

[2addr]s/regular _expression_/replacement/flags
Substitute the replacement string for instances of the regular _expression_ in the pattern space. Any character other than backslash or newline can be used instead of a slash to delimit the RE and the replacement. Within the RE and the replacement, the RE delimiter itself can be used as a literal character if it is preceded by a backslash. An ampersand (&) appearing in the replacement will be replaced by the string matching the RE. The special meaning of "&" in this context can be suppressed by preceding it by backslash.

above reference found at: http://www.opengroup.org/onlinepubs/7908799/xcu/sed.html



Do You Yahoo!?
Make a great connection at Yahoo! Personals.
reply via email to

[Prev in Thread] Current Thread [Next in Thread]