OOPS! Did not look at your script long enough, HERE is one that WORKS!! #!/bin/bash # set the temp file TMP=/tmp/NEO_temp # create the temp file touch $TMP # print the menu and redirect the stderr output to the temp file dialog --menu "The NEO suspend Script" 10 40 5 [suspend suspend] [poweroff poweroff] [reboot reboot] 2>$TMP # make a var = to the temp files contents ANSWER=$(cat $TMP) # check ANSWER for what it contains and for the contents do something case $ANSWER in [suspend ) echo "suspend" > ~/powerstatus ;; [reboot ) echo "reboot" > ~/powerstatus ;; [poweroff ) echo "poweroff" > ~/powerstatus ;; *) echo "INVALID Option!" esac # remove the temp file rm $TMP # done exit Bostjan Muller wrote:
Hi!
I am trying to write a script with dialog, and I can't seem to get it working. I don't know what stderr is (that's where the output of dialog is supposed to go). I have a menu set up in dalog and a test bash commands after it like this: #!/bin/bash dialog --menu "The NEO suspend script" 10 40 5 suspend suspend poweroff poweroff reboot reboot read ans if [ "$ans" = "suspend" ]; then echo suspend > ~/file else echo $ans > ~/file fi
The script does nothing - the read just wait's for the input from the user, i tried read -e and read -p, but it didn't work either. What do I have to do to make the output of dialog readable (or how can I use in a script)?
THX in advance!
Bostjan -- Bo¹tjan Müller [NEONATUS], NEONATUS@bigfoot.com, http://surf.to/NEONATUS RSA id: 0x90178DBD, ICQ #:7506644, PGP key: finger neonatus@gimp.thz.net GEEK CODE = PGP key Registered Linux User #87774, Powered by SuSE Linux 6.2 "I haven't lost my mind; I know exactly where I left it."
-- Carl Johnson Sys Admin cjs@cj-solutions.com |_| |_| | |\/--- | |\ | | | \/ | NIKE | | | \| |__| /\ |______| _______________ ____ | OH SHIT IT's | |..| --| LINUX!!! | |__| |_______________| |\/| icro$oft "Watch Linux walk all over Micro$oft" | | /||\ /\ -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
participants (1)
-
cjs@mcn.net