sbase

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

0007-ed.sh (193B)


      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 printf 'something important' > $tmp
     11 ../ed -s $tmp <<EOF 2>/dev/null | diff -w $tmp -
     12 1p
     13 EOF