Xref: utzoo alt.sources.d:687 comp.sources.d:5643 Path: utzoo!mnetor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!batcomputer!cornell!uw-beaver!ubc-cs!alberta!ccu!mills From: mills@ccu.umanitoba.ca (Gary Mills) Newsgroups: alt.sources.d,comp.sources.d Subject: Re: Unnecessary tar-compress-uuencodes Message-ID: <1990Jul17.201748.21877@ccu.umanitoba.ca> Date: 17 Jul 90 20:17:48 GMT References: <15652@bfmny0.BFM.COM> <3114@psueea.UUCP> <1990Jul10.203015.27282@eci386.uucp> <5256@plains.UUCP> <3124@psueea.UUCP> <2148@mcrware.UUCP> Organization: University of Manitoba, Winnipeg, Canada Lines: 49 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-