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