Created
May 3, 2012 08:29
-
-
Save haad/2584378 to your computer and use it in GitHub Desktop.
Find a server-name in a list of created devices on VIO server and print it's vhost
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/ios/cli/ioscli lsmap -all | egrep 'VTD|vhost' | perl -e 'my $old; while (my $line = <STDIN> ) { if ($line =~ /server-name/) { print "$old$line"; next; } $old = $line; }' | |
/usr/ios/cli/ioscli lsmap -all | egrep 'VTD|vhost' | awk '$0 ~= /server-name/ {print $0" "old;} {old=$0;}' | |
/usr/ios/cli/ioscli lsmap -all | egrep 'VTD|vhost' | awk '/server-name/{print old"\n "$0;} /vhost/{old=$0;}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment