I don't know why you need a HoH to get the next volume
tapeutil -f /dev/smc0 inventory | perl -nle' BEGIN { $slot = shift(@ARGV); } if (/^Slot address (\d+)$/) { $ok = $slot == $1; } elsif ($ok && /^ *Volume Tag[ .]+(.*)/) { print ++($vol=$1); last; } ' 1123
Update: I suppose you want the next volume for a specific slot. Fixed.
In reply to Re: loading a hash of hashes from UNIX command output
by ikegami
in thread loading a hash of hashes from UNIX command output
by novy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |