[alt.sources] 2 scripts useful to me

waynet@tolerant.UUCP (07/17/87)

unshar will unshar multiple raw files saved from readnews.
unpack will unpack archives in the format we get from our neighbor,
pyramid. No guarantees are made that their naming conventions are
conform to any standard.

#! /bin/sh
# To extract, remove mail header lines and type "sh filename"
echo x - unshar
sed -e 's/^X//' > unshar << '!FaR!OuT!'
X#! /bin/sh
X# unshar multiple files - 12/18/86 - W. Thompson
Xfor i
Xdo
X   echo "<-<-<-<-<-<-<-<-<-<- USHARING '$i' ->->->->->->->->->->"
X   awk '
X   /^#/		{ pr = 1 }	# assumed bof
X   /^--$/	{ exit }	# assumed eof
X   pr == 1	{ print }
X   ' $i | sh
Xdone
!FaR!OuT!
if [ `wc -c unshar | awk '{printf $1}'` -ne 250 ]
then
	echo -n Size change in file unshar: was 250, 'is '
	wc -c unshar | awk '{printf $1}'
	echo ''
fi
chmod ugo+x unshar
echo x - unpack
sed -e 's/^X//' > unpack << '!FaR!OuT!'
X#! /bin/sh
X# unpack archives - W. Thompson - 02/19/87
Xfor i
Xdo
X   while true
X   do
X      file=`ls $i*`
X      case $file in
X         *.tar)		tar xvpf $file
X			if [ $? -ne 0 ]
X			then
X			   exit
X			else
X			   break
X			fi
X			;;
X         *.shar)	sh $file
X			if [ $? -ne 0 ]
X			then
X			   exit
X			else
X			   break
X			fi
X			;;
X         *.Z)		uncompress $file
X			if [ $? -ne 0 ]
X			then
X			   exit
X			fi
X			;;
X         *)		break
X			;;
X      esac
Xecho $file
X   done
Xdone
!FaR!OuT!
if [ `wc -c unpack | awk '{printf $1}'` -ne 463 ]
then
	echo -n Size change in file unpack: was 463, 'is '
	wc -c unpack | awk '{printf $1}'
	echo ''
fi
chmod ugo+x unpack
exit
--
Which is worse, ignorance or apathy? Who knows, who cares.

Wayne Thompson
..{bene,mordor,nsc,oliveb,pyramid,ucbvax}!tolerant!waynet

Your mission, should you decide to accept it, is to discern who is
responsible for these opinions, the poster or the company he works for.
Good luck!!