LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-27-2016, 01:16 PM   #1
zvlo
LQ Newbie
 
Registered: Nov 2016
Posts: 5

Rep: Reputation: Disabled
Zenity script help


Hello I am trying to make a zenity program that has to answer these questions.
http://i67.tinypic.com/2qwmvx5.jpg

Here is the code so far Im really confused:
Code:
#!/bin/bash
 

start=1
while [ $start=1 ]
do
P1=$(zenity --forms --text "Employment Information" --title= "Employment Information" --add-entry="Employee Full name" --add-entry="Employee Username" --add-calendar="Date of Birth" --add-list="Select Department" --list-values="HUMAN RESOURCE|FINANCE|SALES|INFOTECH|LOGISTICS" --add-password="Password:" --add-combo="Select Education" --combo-values="Grade 12|Diploma|Adv. Diploma|Graduate|Masters" --separator=: >> emplist.txt)

P2=$(zenity --list --checklist  --title="Technicial Certifications" --text="Select cerifications achieved:" --column="Acquired" --column="Certifications" FALSE "RHCSA" FALSE "RHCSE" FALSE "MCSA" FALSE "CCNA" FALSE "CCNP" FALSE "ITIL" FALSE "PMP" >> emplist.txt)

P3=$(zenity --list  --title "Drivers License" --text "Select Drivers License level: " --radiolist  --column "Acquired/Passed" --column "License level" FALSE "G1" FALSE "G2" FALSE "G" >> emplist.txt)

P4=$(zenity --question --title " " --text "Make another account")

P5=$(zenity --text-info --filename="emplist.txt")

done
In short I need to:

-Make the name inputted in the first entry of the first zenity form prompt appear on the question prompt (P4)
-When I say No on the question prompt(P4) it should redirect me to P5 to show emplist.txt
-When I say yes on the question prompt(P4) it should redirect back to P1 to make another account
-Ok/Cancel should close P5 when pressed
-P2 and P3 should stdout to emplist.txt WITHOUT making a new line and adding to P1s line

Thank you so much

Last edited by zvlo; 11-27-2016 at 09:10 PM.
 
Old 11-27-2016, 09:16 PM   #2
zvlo
LQ Newbie
 
Registered: Nov 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
Hello
I made this code for a zenity program and need help accomplishing some tasks.
In short I need to:

-Make the name inputted in the first entry of the first zenity form prompt appear on the question prompt (P4)
-When I say No on the question prompt(P4) it should redirect me to P5 to show emplist.txt
-When I say yes on the question prompt(P4) it should redirect back to P1 to make another account
-Ok/Cancel should close P5 when pressed
-P2 and P3 should stdout to emplist.txt WITHOUT making a new line and adding to P1s line

Here is the code (I am really confused):
Code:
#!/bin/bash
 

start=1
while [ $start=1 ]
do
P1=$(zenity --forms --text "Employment Information" --title= "Employment Information" --add-entry="Employee Full name" --add-entry="Employee Username" --add-calendar="Date of Birth" --add-list="Select Department" --list-values="HUMAN RESOURCE|FINANCE|SALES|INFOTECH|LOGISTICS" --add-password="Password:" --add-combo="Select Education" --combo-values="Grade 12|Diploma|Adv. Diploma|Graduate|Masters" --separator=: >> emplist.txt)

P2=$(zenity --list --checklist  --title="Technicial Certifications" --text="Select cerifications achieved:" --column="Acquired" --column="Certifications" FALSE "RHCSA" FALSE "RHCSE" FALSE "MCSA" FALSE "CCNA" FALSE "CCNP" FALSE "ITIL" FALSE "PMP" >> emplist.txt)

P3=$(zenity --list  --title "Drivers License" --text "Select Drivers License level: " --radiolist  --column "Acquired/Passed" --column "License level" FALSE "G1" FALSE "G2" FALSE "G" >> emplist.txt)

P4=$(zenity --question --title " " --text "Make another account")

P5=$(zenity --text-info --filename="emplist.txt")

done

Thank you so much

Last edited by zvlo; 11-28-2016 at 09:08 AM.
 
Old 11-27-2016, 09:17 PM   #3
zvlo
LQ Newbie
 
Registered: Nov 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
If anymore screenshots are needed about the zenity programs like P1, P2 and P3 please let me know or just run them yourself they work
 
Old 11-28-2016, 06:21 AM   #4
Habitual
LQ Addict
 
Registered: Jan 2011
Posts: 7,806
Blog Entries: 11

Rep: Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104
When is the test?
 
Old 11-28-2016, 07:09 AM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,627
Blog Entries: 10

Rep: Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680
Per the LQ Rules, please do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and Google searches) and we'll do our best to help. Also, keep in mind that your instructor might also be an LQ member.
 
Old 11-28-2016, 09:09 AM   #6
zvlo
LQ Newbie
 
Registered: Nov 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
When is the test?
Quote:
Originally Posted by rtmistler View Post
Per the LQ Rules, please do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and Google searches) and we'll do our best to help. Also, keep in mind that your instructor might also be an LQ member.
Habitual - Its an assignment lol

rtmistler - Okay I deleted the original pictures of the questions and just left the questions I have about the code.
 
Old 11-28-2016, 10:48 AM   #7
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,627
Blog Entries: 10

Rep: Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680Reputation: 1680
What you've written is not a working script, it is a handful of variable assignments and nothing further.

You need to determine how you can see the output of your first zenith command, to get it to the shell script. Once you know that, you can assign that to a variable and test the variable. You may end up needing to save it to a variable using some other means, for instance capturing the data from stdin as a user enters it.

My signature has a few BASH script references to aid you in better understanding BASH scripting. I also have a blog entry which talks about some ways to debug your scripts.

Some suggestions are to (1) remove the loop and all the following commands and just worry about the first command (2) remember that anything you can type and run from the terminal command line, you can put into a BASH script, and likewise any returns or status you get back you can save as a variable and test withing the BASH script (3) please put in some additional effort to find out how to get the desired output from your first command, I do not have or use zenith and therefore can only assess the flow of your script, which as I've said presently, does not have a flow, it is instead an infinite loop of variable definitions.

To be more effective, you may wish to review the information on good question guidelines for LQ, as well.
 
Old 11-28-2016, 10:52 AM   #8
Habitual
LQ Addict
 
Registered: Jan 2011
Posts: 7,806
Blog Entries: 11

Rep: Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104
http://linux.byexamples.com/archives...og-examples-1/
http://www.howtogeek.com/107537/how-...nity-on-linux/
are where I started in 2007.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Help needed with bash script and zenity. Wizard^^ Programming 4 10-29-2010 10:01 PM
preventing zenity from halting script PiNPOiNT Programming 2 09-22-2009 08:52 PM
Shell script using zenity sandsterother Programming 1 02-14-2008 01:16 AM
Brain cramp using zenity in script ?? wmcase Programming 2 12-03-2006 02:20 PM


All times are GMT -5. The time now is 03:04 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration