Dave's Brain

Browse - computer tips - rot13 script

Date: 2011apr5
OS: Linux

Q.  Can a shell script do rot13 "encryption" ?

A.  Yes, like this:

	#!/bin/sh
	exec tr 'a-zA-Z' 'n-za-mN-ZA-M'

Save it as /usr/local/bin/rot13

and do:

	chmod a+x /usr/local/bin/rot13

Use it like this:

	echo hello | rot13
What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2012, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.
Advertisements: