in reply to Heredoc with system call
While I'm glad you've answered your own question, I have to admit that I'm confused by it. I would expect that the "set"s and the "status" are commands that lsnrctl should receive, and not be separate commands. In that case, I would have expected that they needed to be sent to lsnrctl's STDIN. The easiest way to do that would be:
though that's definitely not the most perlish (and probably won't quite work as-is on Windows). Something more like:system(<<EOF) and die "couldn't run listener control: $?"; echo "set password 'oracle' set current_listener 'LISTENER' status" | lsnrctl EOF
is probably closer, and far more perlish.open my $fh, "|-", "lsnrctl" or die "can't run listener control: $?"; print $fh <<EOF; set password 'oracle' set current_listener 'LISTENER' status EOF close $fh;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Heredoc with system call
by curtisb (Monk) on Dec 18, 2008 at 05:18 UTC | |
by graff (Chancellor) on Dec 18, 2008 at 05:56 UTC | |
|
Re^2: Heredoc with system call
by Anonymous Monk on Apr 22, 2019 at 09:15 UTC | |
by bliako (Abbot) on Apr 22, 2019 at 10:26 UTC | |
by Anonymous Monk on Apr 22, 2019 at 16:37 UTC | |
by bliako (Abbot) on Apr 22, 2019 at 18:03 UTC | |
by LanX (Saint) on Apr 22, 2019 at 10:56 UTC |