xref: /freebsd/contrib/dialog/samples/inputbox7 (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1#!/bin/sh
2# $Id: inputbox7,v 1.9 2020/11/26 00:09:12 tom Exp $
3# An example which produces two widget outputs.
4
5. ./setup-vars
6
7MSG='Hi, this is an input dialog box. You can use \n
8this to ask questions that require the user \n
9to input a string as the answer. You can \n
10input strings of length longer than the \n
11width of the input box, in that case, the \n
12input field will be automatically scrolled. \n
13You can use BACKSPACE to correct errors. \n\n
14Try entering your name below:'
15
16# separate with a line-break (newline)
17SEP='
18'
19
20exec 3>&1
21returntext=`$DIALOG --title "INPUT BOX" --clear --separate-widget "$SEP" "$@" \
22        --inputbox "$MSG" 16 51 \
23	--title "ANOTHER INPUT BOX" \
24        --inputbox "$MSG" 16 51 \
252>&1 1>&3`
26returncode=$?
27exec 3>&-
28
29. ./report-string
30