I have subsequently tested it and it works as I expect it to. I did find that on my AIX, the output of the command isn't exactly the same as described by the OP - specifically there are two spaces before hdisk## but after accounting for that, it works as intended. Update: The modifications I made that may make the difference (as I said, it worked as expected) were as follows:
local $/ = "\n hdisk"; my ($disk) = $_ =~ /\s+(hdisk\w+)/;
Cheers - L~R
In reply to Re^3: Parsing output from a command
by Limbic~Region
in thread Parsing output from a command
by ronix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |