mirror of https://github.com/tLDP/LDP
15 lines
415 B
Bash
15 lines
415 B
Bash
#!/bin/bash
|
|
# rot13.sh: Classic rot13 algorithm,
|
|
# encryption that might fool a 3-year old
|
|
# for about 10 minutes.
|
|
|
|
# Usage: ./rot13.sh filename
|
|
# or ./rot13.sh <filename
|
|
# or ./rot13.sh and supply keyboard input (stdin)
|
|
|
|
cat "$@" | tr 'a-zA-Z' 'n-za-mN-ZA-M' # "a" goes to "n", "b" to "o" ...
|
|
# The cat "$@" construct
|
|
#+ permits input either from stdin or from files.
|
|
|
|
exit 0
|