Sponsored Content
Top Forums Shell Programming and Scripting While read won't run keyboard function Post 303022181 by MadeInGermany on Monday 27th of August 2018 02:28:36 AM
Old 08-27-2018
The read in the pause function competes with the read after while.
You can redirect the read to a keyboard device.
Code:
read -p "Press [Enter] key to continue..."  </dev/tty

Or you can redirect the whole function
Code:
pause </dev/tty

A good alternative is to use another descriptor for the while read
Code:
while read ... <&3
do
   ...
done 3< filename

The descriptor 3 does not clash with the standard descriptors 0=stdin, 1=stdout, 2=stderr
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Why won't my script run?

On the following script that I get an error when I try to execute as root: #./mv_log.sh bash: /root/util/mv_log.sh: Permission denied #!/usr/bin datetag=`date --date='1 day ago' +"%b%d%Y"` logname=`find /opt/bea/wlserver6.1/config/*/logs/ -iname 'access.log0*' -mtime -1 -print` mv... (4 Replies)
Discussion started by: darthur
4 Replies

2. UNIX for Dummies Questions & Answers

Cron won't run properly

I am new to unix, and this is my 1st post on this board. Looking for some advice about a cron job in my server. I am running a cron task that references a script which runs several other scripts and compiles them into a report and emails it to me. If I run the script manually, I will... (2 Replies)
Discussion started by: Steeler_fan
2 Replies

3. UNIX for Dummies Questions & Answers

Made command into a script but now won't run

Hello, After seeing in a Unix cheatsheet that I could add commands into a file and run that file as a command to save on typing, i tried it with this: #! /bin/csh # Backup website excluding directories that do not change rsync -e "ssh -p 2222" -axzvc --progress --stats --compress-level=9... (9 Replies)
Discussion started by: patwa
9 Replies

4. Solaris

smc won't run on a regular user

Hi All, I'm getting this all the time with a regular user (after I do su - and smc): It appears you are attempting to run the graphical Solaris Management Console from a terminal which does not have a suitable 'DISPLAY' environment. Please check your 'DISPLAY' settings and that the user... (5 Replies)
Discussion started by: itik
5 Replies

5. Ubuntu

Toshiba Laptop Won't Run Bluetooth with Ubuntu

I am running Ubuntu 8.1 on a Toshiba Satellite P105-S9337 with built-in Bluetooth hardware. I cannot get the Bluetooth hardware to work with my Microsoft Bluetooth mouse. I have installed the tosh software with no luck. Does anyone have an idea as to what to try. I have several kernel mods... (0 Replies)
Discussion started by: tjloeb
0 Replies

6. SCO

SCO 6.0-Keys in keyboard function differently

Sir I have HP installed with SCO 6.0. The problems are (1) some keys in board like 'del' 'backspace', 'pageup/dn" do not function and display some special characters on conole. (2) Files transferred from Windows machine invariably contain control Z/M characters. How to resolve these issues. ... (4 Replies)
Discussion started by: chssastry
4 Replies

7. UNIX for Dummies Questions & Answers

read from terminal/keyboard > /dev/tty

Hi, I need to provide more than one character to "> /dev/tty" through terminal/keyboard input, I have this: ok=false while do echo " Enter r1 to reformat " > /dev/tty read choice case $choice in ) echo " bla bla bla " ;; done However, in this way,... (3 Replies)
Discussion started by: Gery
3 Replies

8. HP-UX

CDE Login on console won't use keyboard

Hi all, I'm installing a HP r2660 machine with HP-UX 11.23 (this version fixed by customer's product) and I've troubles using the VGA console as workstation display. At first it worked just as TEXT console, then I fixed /etc/dt/config/Xservers and now I've the CDE prompt for login. ... (5 Replies)
Discussion started by: larry100
5 Replies

9. Shell Programming and Scripting

Run command if no mouse or keyboard input

I would like a script that would run pm-suspend if there has been no keyboard or mouse input for a specified time. ------ Post updated at 11:17 AM ------ Never mind. I found a setting in power management that does what I need. (0 Replies)
Discussion started by: drew77
0 Replies

10. UNIX for Beginners Questions & Answers

Bash script won't run because hardware won't produce display

Can anyone offer any advice on how to modify the script below to work on a new system we have, that has no graphics capability? We admin the system through a serial RAS device. I've tried running the below script through the RAS and through an ssh -X session. It failed with something like "GTK... (3 Replies)
Discussion started by: yelirt5
3 Replies
BTKEY(1)						    BSD General Commands Manual 						  BTKEY(1)

NAME
btkey -- Bluetooth Link Key management utility SYNOPSIS
btkey [-CcRrWw] [-k key] -a address -d device btkey -Ll [-d device] DESCRIPTION
The btkey program is used to manage Bluetooth Link Key storage. Keys are normally handled by the bthcid(8) daemon which caches them in the /var/db/bthcid.keys file and provides them as required when Bluetooth connections need to be authenticated. These keys are required for connections between remote devices and the specific controller (not the Operating System) and so for multi-boot systems where it may not always be possible to specify the same key across all OS's it can be better to have the Bluetooth controller provide the keys directly from its semi-permanent memory once devices are paired. btkey will read, write or clear keys in device memory or the key cache as required. Note that without the bthcid(8) daemon running users will be unable to supply PINs, and Link Keys resulting from new pairings will not be stored. If no new pairings are expected and the keys are stored in the controller then bthcid(8) is not required. The options are as follows: -a address Specify the remote device address. May be given as a BDADDR or a name. -C Clear key from device. -c Clear key from file. -d device Specify the local device address. May be given as a BDADDR or a name. -k key Supply a Link Key as a string of hexadecimal digits. Up to 32 digits will be processed and the resulting key will be zero padded to 16 octets. -L List keys stored in device. -l List keys stored in file. -R Read key from device. -r Read key from file. -W Write key to device. -w Write key to file. Super-user privileges are required to read or write link keys. EXIT STATUS
The btkey utility exits 0 on success, and >0 if an error occurs. FILES
/var/db/bthcid.keys EXAMPLES
Read key for mouse at ubt0 from file and write to device btkey -d ubt0 -a mouse -rW Write new key for keyboard at ubt0 to file btkey -d ubt0 -a keyboard -k 92beda6cd8b8f66ebd2af270d55d70ec -w Clear key for phone at bt3c0 from file and device btkey -d bt3c0 -a phone -cC SEE ALSO
btpin(1), btconfig(8), bthcid(8) AUTHORS
Iain Hibbert BSD
November 8, 2007 BSD
All times are GMT -4. The time now is 06:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy