Я хочу задать вопрос о зените, который идет дальше в зависимости от выбранного вами ответа.
Вопрос в моем скрипте:
zenity --question --text="Would you like to participate in a little form?"
_
Полный скрипт
#!/bin/bash
if [ "$(whoami)" != "root" ]; then
echo "Put this is /sbin/ and chmod 755 it."
else
zenity --info --text="Hi! Welcome to !!Name yet to be found!!"
sleep 0.5
zenity --question --text="Would you like to participate in a little form?"
sleep 1
zenity --info --text="Getting important run files"
wget
sleep 1
zenity --info --text="Done!"
sleep 1
zenity --info --text="I will this program will move to /sbin/ and chmod
775 it for you!
No need to thank me.
My program creator made me this way :("
sudo chmod 755 ~/!!!
mv ~/!!! /sbin/
sleep 1
zenity --info --text="Done!"
sleep 2
sudo xdg-open /sbin
zenity --info --text="Well look for yourself!"
sleep 10
zenity --info --text="Dont rerun this file!"
echo
zenity --info --text="This is just the install part."
fi
Как я могу это достичь?
zenity --question вернет ответ пользователя в код выхода. Вы можете собрать его из специальной переменной $?, например
zenity --question --text="Are you there?"
THERE=$?
или использовать его непосредственно в условном выражении
if zenity --question --text="Do you want to answer stupid questions?"
then
zenity --entry --text="Why?"
fi
zenity --question вернет ответ пользователя в код выхода. Вы можете собрать его из специальной переменной $?, например
zenity --question --text="Are you there?"
THERE=$?
или использовать его непосредственно в условном выражении
if zenity --question --text="Do you want to answer stupid questions?"
then
zenity --entry --text="Why?"
fi
zenity --question вернет ответ пользователя в код выхода. Вы можете собрать его из специальной переменной $?, например
zenity --question --text="Are you there?"
THERE=$?
или использовать его непосредственно в условном выражении
if zenity --question --text="Do you want to answer stupid questions?"
then
zenity --entry --text="Why?"
fi