@echo off :: filename: rot13.btm :: notes by: Eric Pement :: updated: 2014-12-06 17:26 :: 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 "a-zA-Z" "n-za-mN-ZA-M" < %1 goto end :filter tr "a-zA-Z" "n-za-mN-ZA-M" goto end :syntax TEXT ROT13 - simple Caesar cipher for reversible obfuscation. ROT13 affects alphabetic characters only (A-Z and a-z), nothing else. Usage: rot13 [file] Samples: {cat|type|echo|etc.} filename | rot13 # use as a filter rot13 filename # use with one argument rot13 /?, /h, -?, --help # brings up this help message ENDTEXT :end