Unnecessary tar-compress-uuencodes

Gary Mills mills at ccu.umanitoba.ca
Wed Jul 18 06:17:48 AEST 1990


Expanding tabs in a shar is no good because it messes up context
diffs.  Encoding them is a better idea.  I use the following shar
from time to time because my Bitnet gateway (via UREP) expands tabs:

----------------8<---------------------8<-------------------8<--------
#!/bin/sh
# tshar: shell archiver that makes tabs visible
#
echo '#! /bin/sh'
echo '# This is a shell archive, meaning:'
echo '# 1. Remove everything above the #! /bin/sh line.'
echo '# 2. Save the resulting text in a file.'
echo '# 3. Execute the file with /bin/sh (not csh) to create:'
for file in "$@"
do
	echo "#	$file"
done
echo "# This archive created: `date`"
logname=${LOGNAME:-"unknown"}
fullname=`grep "^$logname" /etc/passwd | cut -d: -f5`
echo "# By:	$logname ($fullname)"
echo 'export PATH; PATH=/bin:/usr/bin:$PATH'
echo "tab=\`echo \" \" | awk '{printf \"\\\t\\\n\"}'\`"
tab=`echo " " | awk '{printf "\t\n"}'`
for file in "$@"
do
	size=`wc -c < $file`
	echo "echo shar: \"extracting '$file'\" '($size characters)'"
	echo "if test -f '$file'"
	echo "then"
	echo "	echo shar: \"will not over-write existing file '$file'\""
	echo "else"
	echo "	sed -e 's/^X//' -e \"s/\^I/\$tab/g\" << \\SHAR_EOF > '$file'"
	sed -e 's/^/X/' -e "s/$tab/\^I/g" $file
	echo 'SHAR_EOF'
	echo "if test $size -ne \"\`wc -c < '$file'\`\""
	echo "then"
	echo "	echo shar: \"error transmitting '$file'\" '(should have been $size characters)'"
	echo "fi"
	echo "fi"
done
echo "exit 0"
echo '#	End of shell archive'
#


-- 
-Gary Mills-             -University of Manitoba-             -Winnipeg-



More information about the Alt.sources.d mailing list