xref: /freebsd/contrib/dialog/samples/inputbox7 (revision 63d1fd5970ec814904aa0f4580b10a0d302d08b2)
1#!/bin/sh
2# $Id: inputbox7,v 1.7 2010/01/13 10:20:03 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
21RESULT=`$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`
26retval=$?
27exec 3>&-
28
29. ./report-string
30