in reply to system calls and shell aliases

When the system or exec or backticks spawn a shell it doesn't load your settings, and doesn't inherit the current environment.

As a workaround, you could just run "cd $dirname && pwd" as the command instead of "tt". Alternatively (and more robustly), move your "tt" from being an alias to being an executable shell script in say ~/bin/tt .. then your system or backtick call can just run "/home/myname/bin/tt".