Using perl -pe over sed

Annexe

This originally appeared on the Annexe.

If you find sed limiting, you can use Perl instead:

echo something | perl -pe 's/something/else/'

The Perlrun command reference lists the other flags you can use.

Author bio and support

Me!

Ruben Schade is a technical writer and IaaS engineer in Sydney, Australia who refers to himself in the third person in bios. Wait, not BIOS… my brain should be EFI by now.

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or buy some silly merch. Thanks!