fstools : ped (perl editor)

The Problem

If you want to modify files in place you can use:

perl -wpi~ -e 'perl-command' file(s)

But you will run into these problems:

With GNU sed you will have the same problems.

The Solution

With ped you have multiline in-place editing while preserving soft and hard links and ACLs.
ped uses vv for backup (if available).

usage: ped [-n] [-v] 'perl code' file(s)
options: -n  no backup
         -v  verbose mode
example: ped 's/ /_/g' *.txt

ped can be also used as a stream editor for STDIN/STDOUT.

usage: ... | ped 'perl code'
example: ifconfig | ped 's/(.+?)\n\n/{$1\n}\n/sg'

Author: Ulli Horlacher