Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site decwrl.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!zehntel!dual!decwrl!dec-rhea!dec-coevax!lemaire From: lemaire@coevax.DEC (Jim the Slaabsnaab DTN 264-5838) Newsgroups: net.jokes Subject: "tr" command flame Message-ID: <2067@decwrl.UUCP> Date: Wed, 27-Jun-84 15:55:54 EDT Article-I.D.: decwrl.2067 Posted: Wed Jun 27 15:55:54 1984 Date-Received: Sat, 30-Jun-84 03:53:18 EDT Organization: DEC Engineering Network Lines: 76 > >Come off it people. Programs to unrotate? Has anyone ever heard of the >UNIX command 'tr'? To unrotate an entry (from the (ynq) prompt): > > s |tr a-zA-Z n-za-mN-ZA-M > >Now, isn't that difficult? And it's applicable to ANY rotation, not just >13. Just modify the second parameter. > > David Wexelblat > (..decvax!ittvax!wxlvax!dwex) > Hey Dave, has it ever occurred to you that some people might not use unix, preferring operating systems that work? (Whenever I think "unix", the words "bugs" and "arcane" come to mind) VMS has no such "tr" command, so I have been forced to write my own rotate program as I'm sure many others also have done. However, for the benefit of those fortunate enough who don't have to use unix but haven't figured out how to rotate/unrotate, here is my little VAX/BASIC program which does it. 1! & ! Rotate or unrotate (it works both ways) & ! 10 INPUT "File to rotate/un-rotate";FILE$ INPUT "Put new file";OUTPUT$ 20 OPEN FILE$ FOR INPUT AS FILE #1% OPEN OUTPUT$ FOR OUTPUT AS FILE #2% 30 ONERROR GOTO 1000 35 INPUT LINE #1%, A$ FOR I% = 1% TO LEN(A$) B$=SEG$(A$,I%,I%) IF ASCII(B$)>=65 AND ASCII(B$)<=77 THEN B$=CHR$(ASCII(B$)+13%) ELSE IF ASCII(B$)>=78 AND ASCII(B$)<=90 THEN B$=CHR$(ASCII(B$)-13%) ELSE IF ASCII(B$)>=97 AND ASCII(B$)<=109 THEN B$=CHR$(ASCII(B$)+13%) ELSE IF ASCII(B$)>=110 AND ASCII(B$)<=122 THEN B$=CHR$(ASCII(B$)-13%) 40 Q$=Q$+B$ NEXT I% 50 PRINT #2%, Q$ Q$="" GOTO 35 60 CLOSE 1% CLOSE 2% PRINT "All done" GOTO 32767 1000 RESUME 60 IF ERR=11 AND ERL=35 32767 END Well, that's it. I'm sure all you unix lovers will want to flame me to death for this one. Jim Lemaire decwrl!rhea!coevax!lemaire "When the going get's weird, the weird turn pro." - H.S.T.