LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-10-2008, 06:08 AM   #1
FIRATYILDIRIM
LQ Newbie
 
Registered: Dec 2008
Posts: 4

Rep: Reputation: 0
Smile is it possible to have two inputbox in one dialog window in bash?


I want to have a dialog window which gets two number from user... I dont want to ask it in two dialog but i couldn't figure out any solution nor i couldn't find any information about im/possibility of this by google searchs... I can use any solution which can get these two numbers in one dialog window...

Is there any one who can help?

Thanks for your time...
 
Old 12-10-2008, 06:55 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Welcome to LQ!!

How about dialog with the --form option? It's in the man page under "Box options".
 
Old 12-10-2008, 10:39 AM   #3
FIRATYILDIRIM
LQ Newbie
 
Registered: Dec 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Thank you Pixellany

After your advice i made some search on google but i see there is very few dialog examples about --form option. But at the end i could solve my problem and here that part of my code. I hope it can be helpful.

Code:
dialog 	--title "TITLE" \
	--form "NAME" 9 40 2 \
	"1st :" 1 1 "" 1 8 10 20 \
	"2nd :" 2 1 "" 2 8 10 20 2> "filename"
 
Old 12-10-2008, 10:56 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
This is the kind of behavior we like to see from newcomers!! Thanks for the follow-up
 
Old 06-01-2010, 05:26 PM   #5
DrLove73
Senior Member
 
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Blog Entries: 1

Rep: Reputation: 129Reputation: 129
Direct output to variable:
Code:
exec 3>&1
   NewData=$(dialog 	--title "TITLE" \
	--form "NAME" 9 40 2 \
	"1st :" 1 1 "" 1 8 10 20 \
	"2nd :" 2 1 "" 2 8 10 20 \
   2>&1 1>&3)
exec 3>&-

echo $NewData
 
Old 06-01-2010, 07:36 PM   #6
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
2 year old thread.
 
Old 06-02-2010, 04:10 AM   #7
DrLove73
Senior Member
 
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Blog Entries: 1

Rep: Reputation: 129Reputation: 129
Yup, I know. But it came up 4'th in google looking for >"--form" dialog bash< search. And when you use dialog, you need output data inside the variable, not in file. So I knowingly enriched it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash scripting: using color in dialog dansku Programming 4 01-22-2010 08:16 AM
script dialog window in taskbar pixellany Linux - General 0 04-11-2007 04:01 PM
Bash Loop Dialog xlordt Programming 5 09-26-2006 09:40 AM
bash scripting: dialog --inputbox chibiace Linux - Newbie 1 11-08-2004 10:22 PM
Dynamic dialog in bash scripts AndiOliver Programming 3 04-22-2004 02:46 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration