sed – need an example for ”\digit”
Michael Welle
mwe012008 at gmx.net
Sun Feb 26 08:38:09 UTC 2012
Hello,
Johnny Rosenberg <gurus.knugum at gmail.com> writes:
> http://www.delorie.com/gnu/docs/sed/sed_5.html
>
> On that page saw this:
>
> ”\digit
> Matches the digit-th \(...\) reference in the regular expression.”
>
> But I failed to create an example that works.
> Anyone?
echo 'hello crude world' | sed -e 's/^\([ehlo]\+\) \([^ ]*\)\(.*\)$/\1
x \2 x \3/
\n is a back reference to the n. occurrence of a pair of braces.
Regards
hmw
--
biff4emacsen - A biff-like tool for (X)Emacs
http://www.c0t0d0s0.de/biff4emacsen/biff4emacsen.html
Flood - Your friendly network packet generator
http://www.c0t0d0s0.de/flood/flood.html
More information about the ubuntu-users
mailing list