Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

yes/no dialog shell

#!/bin/sh
while true ;do
    [ -x "$(which ${DIALOG%% *})" ] || DIALOG=dialog
    DIALOG=$($DIALOG --menu "Which tool for next run?" 20 60 12 2>&1 
            whiptail       "dialog boxes from shell scripts" >/dev/tty 
            dialog         "dialog boxes from shell with ncurses" 
            gdialog        "dialog boxes from shell with Gtk" 
            kdialog        "dialog boxes from shell with Kde" ) || exit
    clear;echo "Choosed: $DIALOG."
    for i in `seq 1 100`;do
        date +"`printf "XXX
%d
%%a %%b %%T progress: %d
XXX
" $i $i`"
        sleep .0125
      done | $DIALOG --gauge "Filling the tank" 20 60 0
    $DIALOG --infobox "This is a simple info box

No action required" 20 60
    sleep 3
    if $DIALOG --yesno  "Do you like this demo?" 20 60 ;then
        AnsYesNo=Yes; else AnsYesNo=No; fi
    AnsInput=$($DIALOG --inputbox "A text:" 20 60 "Text here..." 2>&1 >/dev/tty)
    AnsPass=$($DIALOG --passwordbox "A secret:" 20 60 "First..." 2>&1 >/dev/tty)
    $DIALOG --textbox /etc/motd 20 60
    AnsCkLst=$($DIALOG --checklist "Check some..." 20 60 12 
        Correct "This demo is useful"        off 
        Fun        "This demo is nice"        off 
        Strong        "This demo is complex"        on 2>&1 >/dev/tty)
    AnsRadio=$($DIALOG --radiolist "I will:" 20 60 12 
        " -1" "Downgrade this answer"        off 
        "  0" "Not do anything"                on 
        " +1" "Upgrade this anser"        off 2>&1 >/dev/tty)
    out="Your answers:
Like: $AnsYesNo
Input: $AnsInput
Secret: $AnsPass"
    $DIALOG --msgbox "$out
Attribs: $AnsCkLst
Note: $AnsRadio" 20 60
  done
Comment

PREVIOUS NEXT
Code Example
Shell :: arangodb arangodump backup 
Shell :: --force-badname 
Shell :: git unable to track file rename 
Shell :: ubuntu dual monitor mouse flicker 
Shell :: make a batch file that accepts pipe input 
Shell :: diff remote file 
Shell :: Errno::EPERM: Operation not permitted @ dir_s_mkdir - /usr/local/Cellar 
Shell :: diff files in different repositories 
Shell :: import tkfontchooser in anaconda 
Shell :: boundEastLongitude: -74.18249700000001 
Shell :: linux inhalt einer textdatei anzeigen 
Shell :: why cant i add some applications to favourite in ubuntu 
Shell :: how to test a 3rd party python library across multiple environments 
Shell :: get my most used command from history 
Shell :: bash nb args 
Shell :: github actions failing sudo: /etc/init.d/mysql: command not found 
Shell :: add computer to collection powershell 
Shell :: inode directory spend 
Shell :: How To Configure WiFi on Raspberry Pi - NAYCode.com 
Shell :: minecraft skript every 1 second 
Shell :: discard-paths: yes 
Shell :: Removing Watermark From Video File With FFMPEG 
Shell :: ubuntu startup run as daemon service 
Shell :: debian user create encypt a passwd 
Shell :: linux c compiler online 
Shell :: real user sys time shell 
Shell :: linux find follow symlinks 
Shell :: github tips 
Shell :: how install hub 
Shell :: powershell scope currentuser 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =