Hello,
I need a little bit of help with 'dialog'.
I am working on the script to add a developer to our system:
shell=""
groups=""
user=""
home=""
exec 3>&1
# Store data to $VALUES variable
VALUES=$(dialog --ok-label "Add" \
--backtitle "Add a developer" \
--title "Useradd" \
--form "Create a new developer" \
15 70 0 \
"Username:" 1 1 "login name" 1 10 20 0 \
"Realname:" 2 1 "real name" 2 10 30 100 \
"E-Mail:" 3 1 "e-mail" 3 10 30 100 \
"Project:" 4 1 "project" 4 10 30 100 \
"GIT Url:" 5 1 "url of git repository" 5 10 30
100 \
"DB dump:" 6 1 "url of database dump" 6 10
40 100 \
"Ssh privkey:" 7 1 "ssh private key" 7 10 40 2048 \
"Ssh pubkey:" 8 1 "ssh public key" 8 10 40 2048 \
2>&1 1>&3)
# close fd
exec 3>&-
echo $VALUES
# display values just entered
user=$(echo $VALUES |cut -f1 -d' ')
rname=$(echo $VALUES |cut -f2 -d' ')
email=$(echo $VALUES |cut -f3 -d' ')
git=$(echo $VALUES | cut -f4 -d' ')
dburl=$(echo $VALUES |cut -f5 -d' ')
privkey=$(echo $VALUES |cut -f6 -d' ')
pubkey=$(echo $VALUES |cut -f7 -d' ')
(it's a test to look at the possibilities offered).
now, I want some of the fields (for example the later 2) to be of a
different type from just the plain inputfield, for example, inputbox.
from what I see, I have to split the form into three steps, like: ask
the first 5 fields at once, store values, then have two separate forms
for keys.
but that is not the way I want it to be like.
I know that zenity can easily do what i want, but it is an X
application, and I need it to be terminal/(n)curses application.
do i have any more options rather then split dialogue into two or more
steps?
--
With best regards,
Gregory Edigarov