pace@micomvax.UUCP (01/05/84)
I am trying to discover how to rotate jokes which will be subsequently posted to the net. At the moment all I know how to do is unrotate jokes while reading them using the readnews command. Any advice or helpful hints greatly appreciated! cheers, Scott Pace Micom Co., Montreal !philabs!micomvax!pace
rpw3@fortune.UUCP (01/13/84)
#R:micomvax:-23100:fortune:12300011:000:920 fortune!rpw3 Jan 12 22:35:00 1984 The easiest way is with 'tr' and 'vi'. Take the following sentence: Q: Here is a test sentence to try "rot" out on. Hey! Now put your cursor on the line (in 'vi') and type "!!tr a-zAZ a-zaB-XA" (copied from another newsgroup, where it was noted non-Berkeley 'tr' needs [a-z][A-Z]) and the line will magically disappear and come back as R: Ifsf jt b uftu tfoufodf up usz "spu" pvu po. Ifz! That is a "rot 1" (or maybe -1). I leave it to you to figure out the letters for rot 13 (you want to decode it with rot -13). In any case, when you have scripts ('rot+' and 'rot-' ?) you can pipe through, compose in 'vi' with "!!rot+" (or "!}rot+" for a paragraph, and read it (from notes) by "saving" it in "|rot-". (And I may have + and - all wrong.) Rob Warnock UUCP: {sri-unix,amd70,hpda,harpo,ihnp4,allegra}!fortune!rpw3 DDD: (415)595-8444 USPS: Fortune Systems Corp, 101 Twin Dolphins Drive, Redwood City, CA 94065
guy@rlgvax.UUCP (Guy Harris) (01/13/84)
Now put your cursor on the line (in 'vi') and type "!!tr a-zAZ a-zaB-XA" (copied from another newsgroup, where it was noted non-Berkeley 'tr' needs [a-z][A-Z]) and the line will magically disappear and come back as... 1) If you don't have an editor which can take text, run it through a filter, and stick the output of the filter back into the file, just edit the file normally and run it through the filter; if you want to rotate only part of it, do some cut and paste work on the original and the filtered output. 2) I suspect "non-Berkeley 'tr'" should translate as "USG UNIX 'tr'", i.e. System III and System V 'tr', among others. The original V7 'tr' - and possibly the original V6 'tr' - may have ran as the Berkeley one does. (There *are* news sites out there on PDP-11s running V7!) That is a "rot 1" (or maybe -1). I leave it to you to figure out the letters for rot 13 (you want to decode it with rot -13). ... (And I may have + and - all wrong.) Since rotations are modulo 26, rot 13 and rot -13 are the same, which is why 13 is the proper rotation for jokes (so nobody has to figure out the direction of the rotation and nobody has to have two rotators). The proper translation for rot 13 is: tr "[a-zA-Z]" "[n-za-mN-ZA-M]" # for USG systems tr "a-zA-Z" "n-za-mN-ZA-M" # for non-USG systems Guy Harris {seismo,ihnp4,allegra}!rlgvax!guy