Creating dialog boxes with the dialog utility

The dialog utility is used to create a basic-level graphical user interface. We can use this in shell script to create very useful programs.

To install the dialog utility in Debian or Ubuntu Linux, enter the following command:

    $ sudo apt-get update
    $ sudo apt-get install l dialog
  

Similarly, enter the following command to install the utility dialog in CentOS or Red Hat Linux:

    $ sudo yum install dialog

The typical syntax of the dialog command is as follows:

    $ dialog --common-options --boxType "Text" Height Width 
                                      --box-specific-option

The common-options utility is used to set the background color, title, and so on in dialog boxes.

The option details are as follows:

  • Text: The caption or contents ...

Get Learning Linux Shell Scripting - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.