Function name as a number?

i have this function that would print out the number "5" in an lcd format. I want to match it to the number 5 so when someone inputs the number 5, this function would be called

function five () {
    r=$1
    c=$2
    tput cup $r $((c+1))
    echo -ne '\u2500'
    tput cup $((r+1)) $((c))
    echo -ne '\u2502'
    tput cup $((r+2)) $((c+1))
    echo -ne '\u2500'
    tput cup $((r+3)) $((c+2))
    echo -ne '\u2502'
    tput cup $((r+4)) $((c+1))
    echo -ne '\u2500'
}

For ksh you could put the function in your .kshrc along with alias 5=five

oh sorry. this is for bash.

Didn't think \u was supported in bash echo - still function and alias should work just use .bashrc

thanks will try that. :slight_smile:

Works for me in Bash 4.2

Not in 4.1.10 :

$ echo $BASH_VERSION
4.1.10(4)-release
$ echo -e '\u2505'
\u2505