dialog - display dialog boxes from shell scripts.
'dialog' is a utility for building console-based 'front ends' in UNIX like operating systems.
In this brief tutorial I am mentioning the usage of few important basic controls available with this 'dialog' utility and later I have created a very simple front end application in UNIX bash scripting using dialog.
note-
first install dialog rpm via YUM
#yum install dialog* -y {In REDHAT}
To install 'dialog' on your ubuntu:
Radiolist box:
The 'radiolist' control box is same as 'checklist' box.
The 'inputbox' allows the user to enter a string.
TextBox:
'dialog' is a utility for building console-based 'front ends' in UNIX like operating systems.
In this brief tutorial I am mentioning the usage of few important basic controls available with this 'dialog' utility and later I have created a very simple front end application in UNIX bash scripting using dialog.
note-
first install dialog rpm via YUM
#yum install dialog* -y {In REDHAT}
To install 'dialog' on your ubuntu:
# apt-get install dialog {In Ubuntu}
Example-1
Checklist box:
A checklist box allows you to present a set of choices to the user
and the user can toggle each one on or off individually using the space
bar.
# dialog --checklist "Choose OS:" 15 40 5 1 Linux off 2 Solaris on 3 'HP UX' off 4 AIX off
Radiolist box:
The 'radiolist' control box is same as 'checklist' box.
# dialog --backtitle "OS infomration" --radiolist "Select OS:" 10 40 3 1 "Linux 7.2" off 2 "Solaris 9" on 3 "HPUX 11i" off
Inputbox:
The 'inputbox' allows the user to enter a string.
# dialog --title "Inputbox - Example" --backtitle "KR Network Cloud" --inputbox "Enter your favourite OS here" 8 50
Menu box:
# dialog --title "A dialog Menu Example" --menu "Please choose an option:" 15 55 5 1 "Add a record to DB" 2 "Delete a record from DB" 3 "Exit from this menu"
message-box:
# dialog --title "Example Dialog message box" --msgbox "\n Installation Completed on host7" 6 50
yesno box:
# dialog --title "Confirmation" --yesno "Want to quit?" 6 20
Infobox:
# dialog --infobox "Processing, please wait" 3 34 ; sleep 5
It is a simple file viewer
# dialog --textbox ~/work/conf.txt 10 4
Gauge Box
#!/bin/sh #A gauge Box example with dialog ( c=10 while [ $c -ne 110 ] do echo $c echo "###" echo "$c %" echo "###" ((c+=10)) sleep 1 done ) | dialog --title "A Test Gauge With dialog" --gauge "Please wait ...." 10 60 0
Calendar Box: #!/bin/sh dat=$(dialog --stdout --title "My Calendar" \ --calendar "Select a date:" 0 0 25 12 2009) case $? in 0) echo "You have entered: $dat" ;; 1) echo "You have pressed Cancel" ;; 255) echo "Box closed" ;; esac
Time Box:
#!/bin/sh
tim=$(dialog --stdout --title "A TimeBox" \
--timebox "Set the time:" 0 0 10 13 59)
case $? in
0)
echo "You have set: $tim" ;;
1)
echo "You have pressed Cancel" ;;
255)
echo "Box closed" ;;
esac
Dear friends..
one of the great things about "dialog" is that there is also "xdialog". xdialog works just like dialog except it uses X to create the same dialog boxes as dialog but in GUI form. So, it is very easy to write a script that checks if X is running and then substitutes xdialog for dialog is it is true. Making your program both terminal and X compatible.
Very nice post. Its is so informative and useful for students. Thanks for sharing this nice post..
ReplyDeleteLinux Training on RHEL 7
It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command
ReplyDeleteJava training in Chennai | Java training institute in Chennai | Java course in Chennai
Java training in Bangalore | Java training institute in Bangalore | Java course in Bangalore
Java online training | Java Certification Online course-Gangboard
Java training in Pune
I would assume that we use more than the eyes to gauge a person's feelings. Mouth. Body language. Even voice. You could at least have given us a face in this test.
ReplyDeletepython interview questions and answers
python tutorials
python course institute in electronic city
Thank you for allowing me to read it, welcome to the next in a recent article. And thanks for sharing the nice article, keep posting or updating news article.
ReplyDeleteData Science course in Indira nagar
Data Science course in marathahalli
Data Science Interview questions and answers
Data science training in tambaram | Data Science Course in Chennai
Data Science course in btm layout | Data Science training in Bangalore
Data science course in kalyan nagar | Data Science Course in Bangalore
This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
ReplyDeleteDevops Training courses
Devops Training in Bangalore
Best Devops Training in pune
Devops interview questions and answers
Really very nice blog information for this one and more technical skills are improve,i like that kind of post.
ReplyDeleteangularjs interview questions and answers
angularjs Training in bangalore
angularjs Training in bangalore
angularjs interview questions and answers
angularjs Training in marathahalli
angularjs interview questions and answers
Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you.
ReplyDeleteKeep update more information..
Selenium training in bangalore
Selenium training in Chennai
Selenium training in Bangalore
Selenium training in Pune
Selenium Online training
Selenium interview questions and answers
Great Article
ReplyDeleteIEEE Projects on Cloud Computing
Final Year Projects for CSE
Best devops online training institute.they are giving complete core subject of devops.and i am very thankfull for this institute.
ReplyDeleteReally very nice blog information for this one and more technical skills are improve,i like that kind of post.keep sharing more information!!!
ReplyDeleteAndroid Training in Chennai | Certification | Mobile App Development Training Online | Android Training in Bangalore | Certification | Mobile App Development Training Online | Android Training in Hyderabad | Certification | Mobile App Development Training Online | Android Training in Coimbatore | Certification | Mobile App Development Training Online | Android Training in Online | Certification | Mobile App Development Training Online
Thanks for sharing such an useful and helpful post.
ReplyDeleteLinux course in Pune