Skip to content

Instantly share code, notes, and snippets.

@cwfoo
Created April 27, 2022 06:03
Show Gist options
  • Save cwfoo/4b0cef73d5a430140193a8f5bae50f16 to your computer and use it in GitHub Desktop.
Save cwfoo/4b0cef73d5a430140193a8f5bae50f16 to your computer and use it in GitHub Desktop.
The ROT13 substitution cipher
#!/bin/sh
# The ROT13 substitution cipher.
[ "$#" -ne 1 ] && printf 'usage: rot13 string\n' && exit 1
printf '%s\n' "$1" | LC_ALL=C tr 'A-Za-z' 'N-ZA-Mn-za-m'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment