[Nottingham] Is everyone "sed -e 's/.../.../ ...'" only?
roger at atchoo.org
Wed Aug 2 12:30:28 UTC 2017
On 2 August 2017 at 13:05, Martin via Nottingham
<nottingham at mailman.lug.org.uk> wrote:
> On 02/08/17 12:22, Andy Smith via Nottingham wrote:
>> I used '/blah/d' yesterday to remove lines matching blah :)
> But, but, but, but...
> That is only shorthand for a 's/.*blah.*//' :-P
Nah, the former is "remove entire lines matching the pattern" and the
latter is "clear any lines matching the pattern".
A more useful point - the "-e" option isn't necessary any more, and in
case you aren't aware "-i" does in place editing of a file, which is
mega useful. I guess I'm showing that when I started using sed it
wasn't as useful as gnu sed.
More information about the Nottingham