Sponsored Content
Full Discussion: dispaly vg's and pv's?
Operating Systems AIX dispaly vg's and pv's? Post 302233193 by bakunin on Saturday 6th of September 2008 04:41:39 PM
Old 09-06-2008
Just a minor observation:

Quote:
Originally Posted by Rob Kerrr
MyID=`lspv $MyPV|grep 'PV IDENTIFIER'|awk '{ print $3}'`
Don't let era, our local "herder of useless cats", see that ;-)) :

.... awk '{ /PV IDENTIFIER/ print $3 }'....

would do the same as "....grep ...| awk ....", yes?

I have long given up on pointing out that backticks are considered harmful in the Korn shell and "`...`" should be replaced by "$(....)".

And for the audience: please use [ code ]...[ /code ]-tags when posting code. The difference is:

with code-tags:
Code:
for MyVG in `lsvg`
do
     echo "\n\n Volume Group: $MyVG\n------------------"
     for MyPV in `lsvg -p $MyVG|grep -v -e $MyVG -e PV_NAME|awk '{ print $1 }'`
     do
          MyID=`lspv $MyPV|grep 'PV IDENTIFIER'|awk '{ print $3}'`
          echo $MyPV $MyID
     done
done

and the same without:
for MyVG in `lsvg`
do
echo "\n\n Volume Group: $MyVG\n------------------"
for MyPV in `lsvg -p $MyVG|grep -v -e $MyVG -e PV_NAME|awk '{ print $1 }'`
do
MyID=`lspv $MyPV|grep 'PV IDENTIFIER'|awk '{ print $3}'`
echo $MyPV $MyID
done
done

bakunin

Last edited by bakunin; 09-06-2008 at 05:47 PM..
 

2 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Issue with dispaly of special character like 'TM'

Hi, I've an xml file with special characetr 'TM' (trade mark sign). The issue is that I am not able to get the symbol 'TM'(trade mark sign) on unix. It displays '?' instead. I've searched the solution on net. Wht I've found is that the symbol 'TM' does not come under ISO-8859-1 char set. So I... (0 Replies)
Discussion started by: vbehal
0 Replies

2. Solaris

Dispaly IP address

How to display the IP address in authlog and sulog? (1 Reply)
Discussion started by: Burhan
1 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 04:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy