shell script to make uuencode work with net software

bet at ecsvax.UUCP bet at ecsvax.UUCP
Thu Aug 9 15:16:38 AEST 1984


Uuencode writes fixed length lines, encoded as printing characters.
However, one of the printing characters it uses is the space character,
and it is significant. Net news software, unfortunately, likes to trim
off trailing blanks. Therefore the following:
---------------- newsencode ----------------------------------------
: Create a shell encoding that will survive netnews, and when run
: will reproduce the file which is its argument
echo '#!/bin/sh'
echo '# This is a shar binary encoding.  Extract with sh, not csh.'
echo '# The rest of this file will extract:' "$1"
echo "sed 's/X$//' << '/*EOF' | uudecode"
uuencode $1 $1 | sed 's/$/X/'
echo "/*EOF"
echo "ls -l $1"
echo "exit"
-------------------------------------------------------------------
To use, type "newsencode foo > bar", then post bar. When somebody runs
bar through the shell, they get foo, and bar should survive netnews
unscathed.

All this is assuming posting of useful binaries isn't condemned as an
antisocial activity, of course. See the current discussion in net.news.

					Bennett Todd
					...{decvax,ihnp4,akgua}!mcnc!ecsvax!bet



More information about the Comp.sources.unix mailing list