Code:
host <ip> | awk '{print $NF}'
that worked out for what i need actually, the next thing is in perl itself. I cant figure why this line of code doesn't work, I have used it in the under different situation in another piece of script.
what i have is the IP address from a CSV log file and it is in the form of \\1.2.3.4 and It is in the array it is $a[6]
Code:
$a[6] = (split(/\\/, $a[6]));
that is what i have it ends up setting $a[6] to 3 only. What did i mess up there?
and to set a variable with the system command would be:
Code:
$host = "system 'host $ip | awk '{print $NF}''";
??? or which is it?