🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.folklore.computers
Article #1264

Re: Cryptic comments (was re: non-volatile memory)

#1264
From: zma... Diomidis Spinellis
Date: Tue, 06 Feb 1990 14:00
64 lines
2925 bytes
In article <1990Feb5.1...@newcastle.ac.uk> Lindsay....@newcastle.ac.uk (Lindsay F. Marshall) writes:
>The program "cyntax" on 8th Edition UNIX had been run through a
>wonderful program (which was not distributed!!) that systematically
>renamed all the files in a directory as c1.c, c2.c etc. and also the
>variable names used in the program which were rewritten with long
>words which were, I suspect, chosen at random from /usr/dict/words.

The following shell script will substitute all the files 
in a directory given as its first argument with words from
the dictionary, starting with a, AAA, AAAS, AArhus, Aaron,
ABA, Ababa, aback etc.  It is supposed to create a script that 
will reverse this effect in /tmp/r.something.  Due to a bug in
tail -r this script will not be complete for big directories.
USE THIS AT YOUR OWN RISK.

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	trashdir
# This archive created: Mon Feb  5 20:51:08 1990
export PATH; PATH=/bin:$PATH
echo shar: extracting "'trashdir'" '(383 characters)'
if test -f 'trashdir'
then
	echo shar: will not over-write existing file "'trashdir'"
else
sed 's/^	X//' << \SHAR_EOF > 'trashdir'
	X#!/bin/sh
	XTMP=/tmp
	XDIR=$1
	XFILES=$TMP/f.$$
	XWORDS=$TMP/w.$$
	XCMD=$TMP/c.$$
	XREV=$TMP/r.$$
	Xtrap '' 0 1 2 3 15
	Xfind $DIR -depth -print >$FILES
	Xhead -`wc -l <$FILES|sed 's/[ 	]*//'` /usr/dict/words >$WORDS
	Xpaste $FILES $WORDS |
	Xsed -e '
	X/^\.	/d
	Xs/\(.*\)\/\(.*\)	\(.*\)/mv \1\/\2 \1\/\3/
	X' >$CMD
	Xrm $FILES $WORDS
	Xtail -r $CMD |
	Xsed -e '
	Xs/mv \(.*\) \(.*\)/mv \2 \1/
	X' >$REV
	Xsh <$CMD
	Xrm $CMD
SHAR_EOF
if test 383 -ne "`wc -c < 'trashdir'`"
then
	echo shar: error transmitting "'trashdir'" '(should have been 383 characters)'
fi
fi # end of overwriting check
#	End of shell archive
exit 0
--
Diomidis Spinellis                  Internet:                 d...@cc.ic.ac.uk
Department of Computing             BITNET:                   d...@cc.ic.ac.uk
Imperial College                    UUCP:   ...!cernvax!cc.imperial.ac.uk!dds
London SW7 2BZ                      JANET:                    d...@uk.ac.ic.cc
Technical Details
Message-ID: <1564@gould.doc.ic.ac.uk>
Path: mbox-mo1.pugleaf.net!gmdzi!unido!mcsun!ukc!icdoc!doc.ic.ac.uk!zmact61
References: <1990Feb5.102014.13316@newcastle.ac.uk>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!gmdzi!unido!mcsun!ukc!icdoc!doc.ic.ac.uk!zmact61
From: zma...@doc.ic.ac.uk (Diomidis Spinellis)
Newsgroups: alt.folklore.computers
Subject: Re: Cryptic comments (was re: non-volatile memory)
Message-ID: <1564@gould.doc.ic.ac.uk>
Date: 6 Feb 90 14:00:19 GMT
References: <1990Feb5.102014.13316@newcastle.ac.uk>
Sender: ne...@doc.ic.ac.uk
Reply-To: d...@cc.ic.ac.uk (Diomidis Spinellis)
Organization: Department of Computing, Imperial College, London, UK
Lines: 64
Posted: Tue Feb  6 15:00:19 1990
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit