| 1 | #!/bin/bash |
| 2 | # rot13.sh: Classic rot13 algorithm, |
| 3 | # encryption that might fool a 3-year old |
| 4 | # for about 10 minutes. |
| 5 | |
| 6 | # Usage: ./rot13.sh filename |
| 7 | # or ./rot13.sh <filename |
| 8 | # or ./rot13.sh and supply keyboard input (stdin) |
| 9 | |
| 10 | cat "$@" | tr 'a-zA-Z' 'n-za-mN-ZA-M' # "a" goes to "n", "b" to "o" ... |
| 11 | # The cat "$@" construct |
| 12 | #+ permits input either from stdin or from files. |
| 13 | |
| 14 | exit 0 |