For those of you unaware of what ROT13 actually is, it is a blindingly basic (think teenage-girl-diary) encryption method which basically consists of rotating each character 13 letters over in the alphabet (i.e. "a" would become "n", "b" would become "o", etc.)
Why would I waste my time doing this? Because ROT13 is used more often than you think. Oh, and because I have no life. Anyhow, without further ado, my ROT13 Conversion Script:
Code: Select all
#!/bin/bash
#ROT13 Script
#Converts text to/from rot13 based on arguments parsed from the command line
#Kasyx
#20080516
args={"$@"}
echo "`echo $@ | tr A-Za-z N-ZA-Mn-za-m`"
exit;
Thus, to use this script you would type something like ./rot13.sh Kasyx is awesome
However, because I am lazy, I want to just type rot13 Kasyx is awesome right into the command line and have it convert for me, so I pay a visit to my bashrc file (differs in location from distro to distro - I use Gentoo, so /etc/bash/bashrc) and add an alias to my rot13 script. Due to being exceptionally anal, all my scripts sit in /usr/local/bin/, thus my alias line would be the following:
Code: Select all
alias rot13='/usr/local/bin/rot13.sh'
Code: Select all
chmod -x rot13.sh
Code: Select all
kasyx@hephaestus ~ $ rot13 Kasyx is awesome
Xnflk vf njrfbzr