Tab key in a script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Tab key in a script
# 1  
Old 10-25-2007
Java Tab key in a script

Hi,

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

Thanks
# 2  
Old 10-25-2007
Have you tried \t ? If not, try it.
# 3  
Old 10-25-2007
Thanks Yogesh, I will try that out.
# 4  
Old 10-26-2007
Quote:
Originally Posted by innocentspirit
Hi,

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

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):

Code:
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.
# 5  
Old 10-29-2007
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Match tab-delimited files based on key

I thought I had this figured out but was wrong so am humbly asking for help. The task is to add an additional column to FILE 1 based on records in FILE 2. The key is in COLUMN 1 for FILE 1 and in COLUMN 1 OR COLUMN 2 for FILE 2. I want to add the third column from FILE 2 to the beginning of... (8 Replies)
Discussion started by: andmal
8 Replies

2. Shell Programming and Scripting

SSH connection killed by Tab key

Hello, I have a very weird problem with my ssh connection. After I log on the server for a while, when I wanted to change directory by pressing Tab key to save some typing, my connection to the server is lost! First I checked my bash-completion setting, which I could not find any problem with,... (9 Replies)
Discussion started by: yifangt
9 Replies

3. Shell Programming and Scripting

awk - Print whole string ending with a Tab if key matched

Hi , I am looking to print the whole string from file2.txt but it is only printing 77 but not the whole matched string from File2.txt Any help is appreciated. Thanks, Script awk ' BEGIN { OFS="\t" out = "a.txt"} NR==FNR && NF {a=$0; next} function print_65_11() { if... (11 Replies)
Discussion started by: High-T
11 Replies

4. Shell Programming and Scripting

Reading user input...problem with tab key

Hi all, I have a little problem with my shell script (reading user input, save user input to variable, invisible characters in the log file :() printf "1. What's your file path?" /path/to/my/file read -e FILE I have invisible characters in my log file (e.g. <ESC> or ^G) when I'm... (3 Replies)
Discussion started by: splendid
3 Replies

5. Solaris

Solaris how to enable auto tab key?

Hi, On Solaris 10, how do I enable the auto tab key? For example, on the Linux, I can type few letters and press the tab key. How do I do the same on Solaris? Thanks. (2 Replies)
Discussion started by: samnyc
2 Replies

6. UNIX for Advanced & Expert Users

How to make "tab" key in mksnt tool kit case sensitive?

I am using MKS Toolkit on windows7, i observed that when i use "tab" key to complete a file/dir name converts into lower case. Eg: I am having a directory named "Dir1", note "D" is in caps. In unix if i had tried pressing "d" and "<tab>" resulted in no result. However in mksnt toolkit, it... (1 Reply)
Discussion started by: sarbjit
1 Replies

7. HP-UX

Tab key and History

Hi, I'm newbie with HP-UX. My Unix install with DB Oracle. In linux, when we type directory we don't need to type full. We can use Tab key. In Unix, i cannot use Tab key and i need to write whole directory. Other thing, how use Arrow key in Unix? I mean use command already i type. Is it... (1 Reply)
Discussion started by: mzainal
1 Replies

8. UNIX for Dummies Questions & Answers

TAB key in AIX

Hi, I want to use the TAB key to list directory (or go to directory or file). For example, dir1/dir2/file1 now if i do $ cd /d and hit TAB it should go to 'dir1'. Thanks (1 Reply)
Discussion started by: welldone
1 Replies

9. Shell Programming and Scripting

TAB key

hi, :) When i press TAB key twice at $ prompt i am getting the following mesage "Display all 3797 possibilities? (y or n)" could u pls tell me the meaning of this message. cheers RRK (1 Reply)
Discussion started by: ravi raj kumar
1 Replies
Login or Register to Ask a Question