sbase

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

0008-ed.sh (236B)


      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 <<EOF > /dev/null
     11 ../ed -s <<EOF > /dev/null
     12 0a
     13 This is important
     14 .
     15 s/^@//
     16 w $tmp
     17 EOF
     18 
     19 echo 'This is important' | diff -u - $tmp