Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Auto-Enter ?
Name: LANkrypt0 Date: May 20, 2003 at 08:45:24 Pacific OS: FreeBSD CPU/Ram: Lots
Comment:
Mind is blanking on this one, but is there a way to have an a "auto-enter" in a read command? I ask because I am revamping an old script I had written for someone, and one of the features is to browse through your contacts. Its is a pain to hit F to go forward and B to go backwards.
Is there anyway for me to just hit F or B (no enter required) to do this?
Name: nails Date: May 20, 2003 at 14:49:00 Pacific
Reply:
Hi:
There's a way, but you have to mess with the terminal driver:
readkey() { oldstty=`stty -g` stty -icanon -echo min 1 time 0 dd bs=1 count=1 /dev/null stty $oldstty }
echo "Press a key" c=$(readkey) echo $c
Regards,
Nails
0
Response Number 2
Name: LANkrypt0 Date: May 21, 2003 at 06:03:51 Pacific
Reply:
Im so close I can taste it :)
The whole thing seems to do exactly what I need except for one thing, I get: dd: unknown operand /dev/null
Any thoughts?
0
Response Number 3
Name: LANkrypt0 Date: May 21, 2003 at 06:07:54 Pacific
Reply:
Forgot to add. If I remove /dev/null I get: 1+0 records in 1+0 records out 1 bytes transferred in 1 secs (1 bytes/sec)
Which is the dd output, and the reason I assume /dev/null was in there.
0
Response Number 4
Name: Nails Date: May 21, 2003 at 07:29:03 Pacific
Reply:
LAN:
You're looking at the output of the dd command. This forum wipes out the arrow keys upon occasion. redirect the output of the dd command to /dev/null, and it should work.
Sorry about that!
Nails
0
Response Number 5
Name: LANkrypt0 Date: May 21, 2003 at 07:46:04 Pacific
Reply:
No need to be sorry, I figured as much and had tried that previously, but when I do that, I get the same output 1+0 records in 1+0 records out 1 bytes transferred in 1 secs (1 bytes/sec)
but now nothing for c (i.e it doesnt echo)
0
Response Number 6
Name: nails Date: May 21, 2003 at 14:47:07 Pacific
Reply:
Sorry again. You need to redirect standard error, file handle 2, to /dev/null, so it's
dd bs=1 count=1 2[greater than sign]/dev/null
At that, is obtained by the dd command so it won't echo unless you echo it after the function call.
Regards,
Nails
0
Response Number 7
Name: LANkrypt0 Date: May 22, 2003 at 05:39:06 Pacific
Summary: The system I am connecting to is a unix sco openserver release 5 machine and I am dialing into the machine. I get the login prompt, but after entering the username it hangs for about 40 seconds, then ...
Summary: Is there any way in where I can auto kill a telnet session running unix? I would like to auto kill any user who is inside Unix thru telnet but not using it. Would appreciate if someone can help me. Th...
Summary: I am looking for the sed command to cancel all the enter keys in a corpus. I have eliminated the tab key with sed -e 's/\t//g' but I don't know how to do it with the enter key. Thank you Edmondo...