How to call shell script into perl?

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

Was this solution helpful to you?

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:

Just Added Q & A:

Find solution

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.