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 -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 :) |
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 Thank you so much |
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
|
When is the test?
|
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.
|
Quote:
Quote:
rtmistler - Okay I deleted the original pictures of the questions and just left the questions I have about the code. |
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. |
http://linux.byexamples.com/archives...og-examples-1/
http://www.howtogeek.com/107537/how-...nity-on-linux/ are where I started in 2007. |
All times are GMT -5. The time now is 03:09 PM. |