Hi Monks,
Currently I am facing a problem in the below perl one liner code which is present in a perl script.
1) In this i would like to replace that "`"(backticks) with system() so that i can capture the status of the command and also would like to redirect the STDERR to the ssh'd node.
Other parts of the code working fine. I have error only this part of the code.
my $command = 'ssh '. $node . ' "perl -e \'while (<>) { chomp; \$_ =~
+/(.*)\\//; \`su xxx -c \"mkdir -p \$1\"\`; \`su xxx -c \"touch \$_\"\
+`;}\' 1>>$storageRootPath_log 2>>$storageRootPath_err"';
my $pid = open ( $sshNodeStdinHandle{$node} , "| $command 2>>sivakumar
+" ); #SK004
print {$sshNodeStdinHandle{$node}} /x/y/z/sample.txt,"\n";
2) If $storageRootPath_log is replaced with actual path, it's working fine. But if i use path assigned to the variable $storageRootPath_log (
$storageRootPath_log = '/x/y/a/log.txt'), it is not working.
I spent the whole day in this issue (tried by escaping double quotes etc.), but i could not able to solve. So can you peopel please help me to resolve this issue.
Thanks & Regards,
R.Sivakumar