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
ZGREP(1)						      General Commands Manual							  ZGREP(1)

NAME
zgrep - search possibly compressed files for a regular expression SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename... DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code: (-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep. If the GREP environment variable is set, zgrep uses it as the grep program to be invoked. EXIT CODE
2 - An option that is not supported was specified. AUTHOR
Charles Levert (charles@comm.polymtl.ca) SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1) ZGREP(1)
All times are GMT -4. The time now is 10:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy