0008-ed.sh (212B)
1 #!/bin/sh 2 3 set -e 4 5 tmp=tmp.$$ 6 7 trap 'rm -f $tmp' EXIT 8 trap 'rm -f $tmp; kill -KILL $$' HUP INT TERM 9 10 ../ed -s <<EOF > /dev/null 11 0a 12 This is important 13 . 14 s/^@// 15 w $tmp 16 EOF 17 18 echo 'This is important' | diff -u - $tmp