$df_ret = `ssh -q rajesh 'df -hP'`;
print "The value is $df_ret";
if ($df_ret =~ /\/boot/)
{
print "The value is $df_ret";
}
Expected result:
/dev/sda1 126931 39530 80848 33% /boot
But, it’s coming whole df -k output. Any idea?
Your regex is matching against the whole output as one string. You probably want to split it into lines, first and then match each line: