0005-ed.sh - sbase - suckless unix tools
(HTM) git clone git://git.suckless.org/sbase
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
0005-ed.sh (206B)
---
1 #!/bin/sh
2
3 set -e
4
5 tmp1=tmp1.$$
6
7 trap 'rm -f $tmp1' EXIT
8 trap 'rm -f $tmp1; kill -KILL $$' HUP INT TERM
9
10 ../ed <<EOF >$tmp1
11 i
12 foo
13 bar
14 .
15 ,t
16 1t
17 2t
18 2,3t
19 3,7p
20 EOF
21
22 diff -u - $tmp1 <<EOF
23 foo
24 bar
25 foo
26 bar
27 bar
28 EOF