in reply to Re: Use a perl variable on a command that prompts for input
in thread Use a perl variable on a command that prompts for input
In addition to Ken's three options here, there is also the possibility of using echo inside the system command as in:
system ("echo my_input | some_command arg arg arg");The advantages I find in this are that it is simple and can easily be tested in the shell before embedding it in your Perl script.
The downside is mostly a lack of portability but also perhaps consideration of properly escaping my_input to cope with the possible shell expansions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Use a perl variable on a command that prompts for input
by andyarp (Initiate) on Oct 23, 2013 at 00:23 UTC | |
|
Re^3: Use a perl variable on a command that prompts for input
by andyarp (Initiate) on Oct 23, 2013 at 00:38 UTC | |
by hippo (Archbishop) on Oct 24, 2013 at 09:01 UTC | |
by andyarp (Initiate) on Oct 26, 2013 at 06:13 UTC |