1#! /bin/sh 2 3test "X${VERBOSE}" = Xtrue && { 4 set -x 5 PS4='> ' 6 exec 8>&2 7 debug_unshar='--debug' 8} || exec 8>/dev/null 9 10tmppfx=shar-2-$$ 11 12mkdir ${tmppfx}.dir ${tmppfx}.d ${tmppfx}.d/one ${tmppfx}.d/two 13for d in "" /one /two 14do 15 dir=${tmppfx}.d${d} 16 echo This file is ${dir}/first > ${dir}/first 17 { 18 printf "This file is ${dir}/second\n" 19 f=0 20 while test $f -lt 32 21 do printf "\\$f" 22 f=`expr $f + 1` 23 done 2>/dev/null 24 printf "\nThis file is ${dir}/second\n" 25 } > ${dir}/second 26done 27 28: ${SHAR=`cd ../src ; pwd`/shar} 29: ${UNSHAR=`cd ../src ; pwd`/unshar} 30( cd ${tmppfx}.d 31 ${SHAR} -m . 2>/dev/null 32) > ${tmppfx}.shar 33 34: ${DIFF=diff} 35 36cd ${tmppfx}.dir 37${UNSHAR} ${debug_unshar} ../${tmppfx}.shar || exit 1 38cd .. 39 40${DIFF} -r ${tmppfx}.d ${tmppfx}.dir || exit 1 41 42rm -rf ${tmppfx}.* 43exit 0 44 45## Local Variables: 46## mode: shell-script 47## tab-width: 8 48## indent-tabs-mode: nil 49## sh-indentation: 2 50## sh-basic-offset: 2 51## End: 52 53## end of shar-2 54