Printing verbose progress from sed and awk

This is based on potong’s answer. The following code replaces ‘ll’ with ‘zz’, creates a backup file, displays the new text, and writes the change(s) into the file.

$ echo hello > test
$ sed -e 's/ll/zz/;w /dev/stdout' -i .backup test
hezzo
$ cat test
hezzo
$ cat test.backup 
hello

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)