sbase

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

0012-ed.sh (196B)


      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 w
     21 e !printf 'x\ny\n'
     22 ,p
     23 f
     24 EOF