scc

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

0037-update.sh (453B)


      1 #!/bin/sh
      2 
      3 set -e
      4 
      5 tmp1=`mktemp`
      6 tmp2=`mktemp`
      7 
      8 trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3
      9 
     10 ############################################################################
     11 #Update one member that doesn't exist and using -a
     12 
     13 echo First > file-1
     14 
     15 cp master.a file.a
     16 ar -rv -a file1 file.a file-1
     17 
     18 ar -p file.a file-1 > $tmp1
     19 
     20 cat <<EOF > $tmp2
     21 First
     22 EOF
     23 
     24 cmp $tmp1 $tmp2
     25 
     26 ar -t file.a > $tmp1
     27 
     28 cat <<EOF > $tmp2
     29 file1
     30 file-1
     31 file2
     32 file3
     33 EOF
     34 
     35 cmp $tmp1 $tmp2