Debian Codegraph @

samples/form3

raw symbols SCIP
1 #! /bin/shscip-shell filesystem . . `/bin/sh`.
2 # $Id: form3,v 1.10 2024/03/06 21:29:51 tom Exp $
3 # form1 with --help-button
4
5 . ./setup-varsscip-shell source . . `./setup-vars`.
6
7 backtitle="An Example for the use of --form:"
8
9 ids=`idscip-shell system . . id.|sedscip-shell system . . sed. -e 's/([^)]*)//g'`
10 uid=`echoscip-shell system . . echo. "$ids" | sedscip-shell system . . sed. -e 's/^uid=//' -e 's/ .*//'`
11 gid=`echoscip-shell system . . echo. "$ids" | sedscip-shell system . . sed. -e 's/^.* gid=//' -e 's/ .*//'`
12
13 user="$USER"
14 home="$HOME"
15
16 returncode=0
17 while testscip-shell system . . test. $returncode != 1 && testscip-shell system . . test. $returncode != 250
18 do
19 exec 3>&1
20 returntext=`$DIALOG --ok-label "Submit" \
21 --help-button \
22 --backtitle "$backtitle" "$@" \
23 --form "Here is a possible piece of a configuration program." \
24 20 50 0 \
25 "Username:" 1 1 "$user" 1 10 10 14 \
26 "UID:" 2 1 "$uid" 2 10 8 4 \
27 "GID:" 3 1 "$gid" 3 10 8 4 \
28 "HOME:" 4 1 "$home" 4 10 40 255 \
29 2>&1 1>&3`
30 returncode=$?
31 exec 3>&-
32
33 show=`echoscip-shell system . . echo. "$returntext" |sedscip-shell system . . sed. -e 's/^/ /'`
34
35 case $returncode in
36 $DIALOG_CANCEL)
37 "$DIALOG" \
38 --clear \
39 --backtitle "$backtitle" \
40 --yesno "Really quit?" 10 30
41 case $? in
42 $DIALOG_OK)
43 break
44 ;;
45 $DIALOG_CANCEL)
46 returncode=99
47 ;;
48 esac
49 ;;
50 $DIALOG_OK)
51 "$DIALOG" \
52 --clear \
53 --backtitle "$backtitle" --no-collapse --cr-wrap \
54 --msgbox "Resulting data:\n\
55 $show" 10 40
56 ;;
57 $DIALOG_HELP)
58 "$DIALOG" \
59 --clear \
60 --backtitle "$backtitle" --no-collapse --cr-wrap \
61 --msgbox "Help data:\n\
62 $show" 10 40
63 ;;
64 *)
65 . ./report-buttonscip-shell source . . `./report-button`.
66 exit
67 ;;
68 esac
69 done