File: rot13

package info (click to toggle)
hxtools 20201116-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,696 kB
  • sloc: ansic: 5,074; perl: 3,589; cpp: 2,152; sh: 1,610; asm: 173; makefile: 153
file content (17 lines) | stat: -rwxr-xr-x 423 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
#
#	do ROT13 substituion cipher
#	written by Jan Engelhardt, 2013
#
#	This program is free software; you can redistribute it and/or
#	modify it under the terms of the WTF Public License version 2 or
#	(at your option) any later version.
#

if [ "$#" -gt 1 ]; then
	cat "$@" | tr 'A-Za-z' 'N-ZA-Mn-za-m';
elif [ "$#" -eq 1 ]; then
	exec tr 'A-Za-z' 'N-ZA-Mn-za-m' <"$1";
else
	exec tr 'A-Za-z' 'N-ZA-Mn-za-m';
fi;