sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

0013-ed.sh (194B)


      1 #!/bin/sh
      2 
      3 tmp=tmp.$$
      4 
      5 trap 'rm -f $tmp' EXIT
      6 trap 'rm -f $tmp' HUP INT TERM
      7 
      8 cat <<EOF >$tmp
      9 x
     10 y
     11 /dev/null
     12 EOF
     13 
     14 ../ed -s /dev/null <<EOF  | diff -u $tmp -
     15 a
     16 1
     17 2
     18 3
     19 .
     20 E !printf 'x\ny\n'
     21 ,p
     22 f
     23 EOF