Here is a short script which will do what you want. Run it as:
scriptname letter
and see the magic.


#!/bin/bash
upletter () 
{
octal=`echo -n $L | od -A n -o`
new_octal=`echo "obase = 8;ibase=8;$octal + 1" | bc`
L=`eval echo -e \\\\\\\\$new_octal`
}
L=$1
upletter 
echo This is the new letter $L

I have no idea why I had to use the eval statement and all the slashes
in front of $new_octal, but it works. That is the kind of thing I can
imagine breaking between different versions of bash.
Joel

_______________________________________________
Linux-users mailing list - http://linux.nf/mailman/listinfo/linux-users
Subscribe/Unsubscribe info, Archives,and Digests are located at the above URL.

Reply via email to