1 |
Peter Humphrey writes: |
2 |
|
3 |
> On Wednesday 24 June 2009 12:28:05 Alex Schuster wrote: |
4 |
> > man sed answers your second question :) |
5 |
> |
6 |
> s/regexp/replacement/ |
7 |
> Attempt to match regexp against the pattern space. If successful, |
8 |
> replace that portion matched with replacement. The replacement may |
9 |
> contain the special character & to refer to that portion of the |
10 |
> pattern space which matched, and the special escapes \1 through \9 to |
11 |
> refer to the corresponding matching sub-expressions in the regexp. |
12 |
> |
13 |
> No mention of using a different separator, and I couldn't find any other |
14 |
> reference either. I did look before asking. |
15 |
|
16 |
Oh, sorry. I thought the german man pages were just translations of the |
17 |
original man pages, but at least the one for sed is entirely different. It |
18 |
also mentions the flags like g to replace globally, not only the first |
19 |
instance. |
20 |
|
21 |
Here is the OpenBSD man page for sed, it has more information. However, this |
22 |
sed is a little different from our GNU sed. For example, it does not have |
23 |
the -i option. |
24 |
|
25 |
http://www.rocketaware.com/man/man1/sed.1.htm |
26 |
|
27 |
Wonko |