How to do it...

  1. We are going to write a script for a Yes/No box. In that script, we are going to use the if condition. Create the yes_no.sh script and add the following content to it:
dialog --yesno "Do you wish to continue?" 0 0a=$?if [ "${a}" == "0" ]; then    echo Yeselse    echo Nofi
  1. We'll use dialog's calendar. Create a calendar_dialog.sh script. In that, we'll select a specific date:
dialog --calendar "Select a date... " 0 0 1 1 2018val=$?
  1. We're going to use the checklist option of dialog. Create a checklist_dialog.sh script. In that, we'll select multiple options:
dialog --stdout --checklist "Enable the account options you want:" 10 40 3 \              1 "Home directory" on \              2 "Signature file" off \              3 "Simple password" off
  1. Now, we are going ...

Get Bash Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.