UNIX shell script question?
-
Hi guys, I want to create a shell script file (let's say 'answers'), which will call another script file (let's say 'questions'). The 'questions' script will ask three questions: what's your name?, what's your address?, who is your wife?. Then, 'answers' script will give the answers. How can I create the 'answers' script to give the information to 'questions' script?
-
Answer:
I'd use a temp file and have questions write the results there, and then answers can open it. You may find the $$ shell variable useful for generating temp file names. If questions prompts the user for input, you might want to pass the temp file name on the command line to questions (since you won't be able to redirect stdout).
dhtjtks33 at Yahoo! Answers Visit the source
Other answers
I'd use a temp file and have questions write the results there, and then answers can open it. You may find the $$ shell variable useful for generating temp file names. If questions prompts the user for input, you might want to pass the temp file name on the command line to questions (since you won't be able to redirect stdout).
John H
Related Q & A:
- Is there any functional-like Unix shell?Best solution by Super User
- How come CD doesn't work in my shell script?Best solution by Super User
- How to convert Oracle script to MySQL script?Best solution by Stack Overflow
- How to execute Unix shell script from Windows?Best solution by Stack Overflow
- how can I write this shell script in python?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.