I have a bash script that sets two variables to values (not a STDOUT) . I want to store those variables inside a perl script.
Sorry dont have example.. but this is the requirement. any thoughts please
In shell script i am doing something like this
source <Script Name> <Variable1> <Variable2>
Value1=$output1
Value2=$output2
===================== I want to do same inside perl
Tried
system("sh <Script> <Variable1> <Variable2>");
$Value1 = "$output1";
$Value2 = "$output2";
print $Value1
Getting Blank
<Script Name>sets the variables$output1and$output2?sh), so I suggest to remove the bash tag. For sending values from your bash script back to Perl, you can use either stdout, or an external file, or maybe a bidirectional pipe. In all cases, you have to parse the output from your script.