0020-ed.sh (190B)
1 #!/bin/sh 2 tmp=tmp.$$ 3 4 trap 'rm -f $tmp' EXIT 5 trap 'rm -f $tmp; kill -KILL $$' HUP INT TERM 6 7 set -e 8 9 ../ed -s $tmp <<EOF >/dev/null 10 a 11 1 12 2 13 . 14 w 15 5d 16 X 17 EOF 18 19 printf '1\n2\n1\n2\n' | diff -u $tmp -