File: rot13

package info (click to toggle)
hxtools 20231224-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,640 kB
  • sloc: ansic: 4,825; perl: 3,463; sh: 1,629; cpp: 353; makefile: 149
file content (12 lines) | stat: -rwxr-xr-x 247 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
# SPDX-License-Identifier: MIT
#
#	do ROT13 substituion cipher

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;