ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a shell script I'm making to automate some CIAO processes. It's working fine but I can't leave it alone to go work on other stuff b/c it queries me for parameter responses ('Enter','yes','no','filename',etc).
All of these parameters I have already defined in the script but the program the script is running produces these queries anyway. So bottom line is I just need to press 'Enter' whenever a query pops up.
Example:
Code:
user$ ./specextract.sh
...
...
Combine ungrouped output spectra and responses? (no):
Create background ARF and RMF? (yes):
Running: specextract
Version: 14 February 2012
Is there a way to incorporate the responses into the script?
Do you have an idea where do those prompts come from? From the ciao.bash script? From the specextract binary? Or somewhere in the "bunch of parameter definitions" part?
for example, if the parameters are read with something like
Code:
read -p "Do you want whatever?" -e -i "yes" variable
You may try giving the script the default answers, such as
I could only find the binaries on my work computer so I cannot be
certain but I believe these are coming from the specextract binary.
I found the names of these two boolean switchesset them to 'no' and
'yes' respectively and that solved the problem.
I'm not sure if what I wanted to do was valid for this instance but
you actually helped me with another script I have so your knowledge
did not go unappreciated. Thank you very much!
Well, it seems you've solved it, but in future cases you might also look into writing an expect script. That's its whole purpose -- automating user input.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.