@echo off :: filename: rot47.btm :: notes by: Eric Pement :: updated: 2014-12-06 17:25 :: requires: tr if "%1" eq "/?" .or. "%1" eq "/h" .or. "%1" eq "-?" .or. "%1" eq "--help" goto syntax if "%1" eq "" goto filter if not exist %1 (echo Input file [%1] not found. %+ quit) :: else, we must have one argument here.... :: GNU 'tr' does not support the System V syntax that uses square brackets :: to enclose ranges. (see additional notes in GNU info page) tr "!-~" "P-~!-O" < %1 goto end :filter tr "!-~" "P-~!-O" goto end :syntax TEXT ROT47 - simple Caesar cipher with a larger alphabet than ROT13. ROT13 affects alphabetic characters only. ROT47 affects all 94 printable characters: !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ and the 62-character set [0-9A-Za-z]. Literal cmd: tr '!-~' 'P-~!-O' Usage: rot47 [file] Samples: {cat|type|echo|etc.} filename | rot47 # use as a filter rot47 filename # use with one argument rot47 /?, /h, -?, --help # brings up this help message ENDTEXT :end