08-26-2018
Quote:
Originally Posted by
annacreek
I am using while read do/ done to retrieve menu item.
Works as advertised, no problem.
I am using this hack function "pause" to stop script execution and wait for keyboard "enter" key to continue. Sort of break point function. Also works fine with one exception - it does not work when used within while do/done code.
No big issue, but like to know what so special with while do /cone code.
First off: while-loops are not special at all. AND you might want to investigate the
select-keyword of the shell instead of rolling your own replacement for it.
One possible reason (to be honest there is too little information to accurately debug your problem) is that
read reads from standard input. If you have redirected this input somewhere above in your script than it might read from some unexpected place.
I hope this helps.
bakunin
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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
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
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
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
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
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
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
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
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
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
LEARN ABOUT OPENDARWIN
install_keyboard
install_keyboard(3alleg4) Allegro manual install_keyboard(3alleg4)
NAME
install_keyboard - Installs the Allegro keyboard interrupt handler.
SYNOPSIS
#include <allegro.h>
int install_keyboard();
DESCRIPTION
Installs the Allegro keyboard interrupt handler. You must call this before using any of the keyboard input routines. Once you have set up
the Allegro handler, you can no longer use operating system calls or C library functions to access the keyboard.
Note that on some platforms the keyboard won't work unless you have set a graphics mode, even if this function returns a success value
before calling set_gfx_mode. This can happen in environments with graphic windowed modes, since Allegro usually reads the keyboard through
the graphical window (which appears after the set_gfx_mode call). Example:
allegro_init();
install_timer();
install_keyboard();
/* We are not 100% sure we can read the keyboard yet! */
if (set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0) != 0)
abort_on_error("Couldn't set graphic mode!");
/* Now we are guaranteed to be able to read the keyboard. */
readkey();
RETURN VALUE
Returns zero on success, or a negative number on failure (but you may decide not to check the return value as this function is very
unlikely to fail).
SEE ALSO
remove_keyboard(3alleg4), poll_keyboard(3alleg4), key(3alleg4), keypressed(3alleg4), readkey(3alleg4), ureadkey(3alleg4), keyboard_call-
back(3alleg4), keyboard_ucallback(3alleg4), keyboard_lowlevel_callback(3alleg4), three_finger_flag(3alleg4), key_led_flag(3alleg4),
set_leds(3alleg4), set_keyboard_rate(3alleg4), set_gfx_mode(3alleg4)
Allegro version 4.4.2 install_keyboard(3alleg4)