yeah i know that tty is a command, but i sure can take the output of tty in a variable, named tty..by doing tty=`tty`.....that is what i am saying....
but i think you are right ..m0rl0ck is confused how to use the commands and variables in the if statement..
i did not know about the string manipulation like you showed in your later example....
i used awk as i was just dabbling with it for similar purposes right now...