0026-extract.sh (724B)
1 #!/bin/sh 2 3 set -e 4 5 tmp1=`mktemp` 6 tmp2=`mktemp` 7 8 trap "rm -f file* $tmp1 $tmp2" 0 2 3 15 9 10 ############################################################################ 11 #extract all members 12 13 cp master.a file.a 14 $EXEC scc ar -xv file.a file1 file2 file3 15 16 cat <<EOF > $tmp1 17 This is the first file, 18 and it should go in the 19 first position in the archive. 20 But this other one is the second one, 21 and it shouldn't go in the first position 22 because it should go in the second position. 23 and at the end, this is the last file 24 that should go at the end of the file, 25 thus it should go in the third position. 26 EOF 27 28 cat file1 file2 file3 > $tmp2 29 30 cmp $tmp1 $tmp2 31 32 if test `ls file? | wc -l` -ne 3 33 then 34 echo some error extracting files 35 exit 36 fi