scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

0002-append.sh (535B)


      1 #!/bin/sh
      2 
      3 set -e
      4 
      5 trap 'rm -f file* $tmp1' EXIT
      6 trap 'exit 1' HUP INT TERM
      7 
      8 tmp1=tmp1.$$
      9 
     10 ###########################################################################
     11 #Append generated files one by one to an empty file
     12 
     13 echo First > file1
     14 echo Second > file2
     15 echo Third > file3
     16 
     17 rm -f file.a
     18 $EXEC scc ar -qv file.a file1
     19 $EXEC scc ar -qv file.a file2
     20 $EXEC scc ar -qv file.a file3
     21 
     22 $EXEC scc ar -t file.a > $tmp1
     23 diff -u $tmp1 - <<EOF
     24 file1
     25 file2
     26 file3
     27 EOF
     28 
     29 $EXEC scc ar -p file.a > $tmp1
     30 diff -u $tmp1 - <<EOF
     31 First
     32 Second
     33 Third
     34 EOF