0008-ed.sh - sbase - suckless unix tools
HTML git clone git://git.suckless.org/sbase
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
0008-ed.sh (212B)
---
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 -s <<EOF > /dev/null
11 0a
12 This is important
13 .
14 s/^@//
15 w $tmp
16 EOF
17
18 echo 'This is important' | diff -u - $tmp