Tab key in a script

Hi,

How do I execute/emulate the <Tab> keypress from within a script? Any pointers will be helpful.

Thanks

Have you tried \t ? If not, try it.

Thanks Yogesh, I will try that out.

Do you mean you want to use the tab character (ASCII 9) in a script?

If so, it helps to store a literal tab in a variable (by any of several means):

TAB="	" ## a literal tab

TAB=$( printf "\t" )

TAB=$'\n'  ## bash, ksh93

printf -v TAB "\t" # bash3

When you use the variable, be sure to quote it.

Thanks cfajohnson, I will try that out......

Well what I am looking for is this - in our zsh environment, when I execute the following command manually;

cd @TEST <Tab> # where TEST is a MNEMONIC defined in the Version control system.

becomes

cd /dev/appli/adaptation/sw/sw_platform/ssun/test

<Tab> key press takes us to the location of the MNEMONIC in our folder structure. I want to replicate the same from within a script.