Skip to content

Instantly share code, notes, and snippets.

@c0psrul3
Last active April 19, 2017 13:51
Show Gist options
  • Save c0psrul3/dff0ed9e655ea1d249dc9aa7ffa78378 to your computer and use it in GitHub Desktop.
Save c0psrul3/dff0ed9e655ea1d249dc9aa7ffa78378 to your computer and use it in GitHub Desktop.
lol.... ROT-13
#!/bin/bash
# copied from examples provided by Linuxtopia
# [[http://www.linuxtopia.org/online_books/advanced_bash_scripting_guide/textproc.html#ROT13]]
# rot13.sh: Classic rot13 algorithm,
# encryption that might fool a 3-year old.
# 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", etc.
# The 'cat "$@"' construction
#+ permits getting input either from stdin or from files.
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment