I have a made a script on bash.
#!/bin/bash
zen(){
mark=$(zenity --scale \
--text 'FREQUENCY' \
--value=$la \
--min-value=0\
--max-value=5000 \
--step=1)
}
la=500
echo "Script for shim. Regulary frequency"
zen
while [ true ]
do
case $? in
0) echo $mark
la=$mark
#zenity --notification --window-icon="info" --text="Thank you!" --timeout=1
zen
;;
1)
# exit 1
# sl -e || break
# break
# return 1
;;
esac
done
echo "thanks for using!"
It works okay, excluding exit point. # stands before options I have tried, and every one of them does not allow to exit this script correctly and instead of "thanks for using!" or just nothing I am getting in terminal:
This option is not available. Please see --help for all possible usages.
This option is not available. Please see --help for all possible usages.
This option is not available. Please see --help for all possible usages.
This option is not available. Please see --help for all possible usages.
This option is not available. Please see --help for all possible usages.
This option is not available. Please see --help for all possible usages.
This option is not available. Please see --help for all possible usages.
This option is not available. Please see --help for all possible usages.
This option is not available. Please see --help for all possible usages.
This option is not available. Please see --help for all possible usages.
This option is not available. Please see --help for all possible usages.
This option is not available. Please see --help for all possible usages.
^XThis option is not available. Please see --help for all possible usages.
This option is not available. Please see --help for all possible usages.
This option is not available. Please see --help for all possible usages.
This option is not available. Please see --help for all possible usages.
.........................................
It looks like it is problem with zenity, when I am trying to exit the script. I looked this error up and only sound thought was to upgrade zenity, which I have done but it has given me nothing new...
So how can I solve it and break this script correctly..?
My OS is Ubuntu Server 16.04
EDIT
By my script I would like to achieve repeating question from zenity till the moment when user clicks 'cancel'
while [ true ]
does work as expected but probably not for the reason you assume. Thecase $? in
refers to the[ true ]
and not to thezen
. And obviously yourzenity
call is wrong.zenity
call looks like.