sbase

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

0001-echo.sh (249B)


      1 #!/bin/sh
      2 
      3 set -e
      4 
      5 tmp1=tmp1.$$
      6 tmp2=tmp2.$$
      7 
      8 cleanup()
      9 {
     10 	st=$?
     11 	rm -f $tmp1 $tmp2
     12 	exit $st
     13 }
     14 
     15 trap cleanup EXIT HUP INT TERM
     16 
     17 cat <<'EOF' | tr -d '\n' > $tmp1
     18 --hello-- --world--!
     19 EOF
     20 
     21 ../echo -n --hello-- --world--! > $tmp2
     22 
     23 diff -u $tmp1 $tmp2