The input box (inputbox)

Whenever we want to ask a user to input text via the keyboard, in such situations, the inputbox option is useful. While entering text via the keyboard, we can use keys such as Delete, Backspace, and the arrow cursor keys for editing. If the input text is larger than the input box, the input field will be scrolled. Once the OK button is pressed, the input text can be redirected to a text file:

    # dialog  --inputbox  "Please enter something."   10  50 
    2> /tmp/tempfile
    VAR=`cat ~/work/output.txt
  

Let's write the dialog_02.sh shell script to create an input box as follows:

#!/bin/bash result="output.txt" >$ $result # Create ...

Get Learning Linux Shell Scripting - Second Edition 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.