the script display's list of volume groups followed by physical volumes with in volume group and at the same time the script should display the pvid of physical volume.
what i need is, how to read the line by line from the files...
the below is my script..
echo "List of Volume Groups and Physical Volume:"
while read xxxxxx (the xxxx should read from file reportvg.out)
do
lsvg -p xxxxxx > reportpv.out (the xxxxx is vg anme)
while read xxxxxx ( the xxxx is the pv name from reportpv.out)
do
lspv xxxxx | grep IDENTIFIER ( the xxxx is pv name)
done reportpv.out
done reportvg.out
can anyone help me on this.
thanks
Last edited by honeym210; 09-05-2008 at 11:59 AM..
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:
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
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)