scc

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

0022-list.sh (964B)


      1 #!/bin/sh
      2 
      3 set -e
      4 
      5 tmp1=`mktemp`
      6 tmp2=`mktemp`
      7 
      8 trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3
      9 
     10 ############################################################################
     11 #list 1st member
     12 
     13 cp master.a file.a
     14 
     15 scc-ar -t file.a file1 > $tmp1
     16 
     17 cat <<! > $tmp2
     18 file1
     19 !
     20 
     21 cmp $tmp1 $tmp2
     22 
     23 ############################################################################
     24 #print 3rd member
     25 
     26 scc-ar -t file.a file3 > $tmp1
     27 
     28 cat <<! > $tmp2
     29 file3
     30 !
     31 
     32 cmp $tmp1 $tmp2
     33 
     34 ############################################################################
     35 #print 2nd member with verbose
     36 
     37 scc-ar -tv file.a file2 >$tmp1
     38 
     39 cat <<! > $tmp2
     40 rw-r--r-- `id -u`/`id -g`	Tue Jan  1 00:00:00 1980 file2
     41 !
     42 
     43 cmp $tmp1 $tmp2
     44 
     45 ############################################################################
     46 #print all members
     47 
     48 scc-ar -t file.a file1 file2 file3 >$tmp1
     49 
     50 cat <<! > $tmp2
     51 file1
     52 file2
     53 file3
     54 !
     55 
     56 cmp $tmp1 $tmp2
     57 
     58 #and now with no members in command line
     59 
     60 scc-ar -t file.a > $tmp1
     61 
     62 cmp $tmp1 $tmp2