Hello,
I'm currently writing my first script in ksh and I'm trying to use awk to manipulate some lines.
I'm writing this script to extract Logical Volume informations on a AIX server to generate the creation script.
All the steps are Ok without one.
What I do :
The result of this command is like this:
datavg
128
datavg2
256
datalvg39
128
rootvg
128
What I want is to have the result like this:
datavg 128
datavg2 256
datalvg39 128
rootvf 128
Does anyone have an idea how to do that ?
Thanks in advance for your help and your comprehension for my first script !
I'm currently writing my first script in ksh and I'm trying to use awk to manipulate some lines.
I'm writing this script to extract Logical Volume informations on a AIX server to generate the creation script.
All the steps are Ok without one.
What I do :
Code:
lsvg $vggroup | grep -iE "VOLUME GROUP|PP SIZE" | awk -f /tmp/test.awk
[/code}
Awk script test.awk:
[code]
{
if ( $1 == "VOLUME" ) {
if ( $2 == "GROUP:" ) {
print $3
} else {
print "Il y a un probleme"
}
} else if ($1 == "VG" ) {
print $6
} else {
print "Aucun caratere trouvé"
}
}
The result of this command is like this:
datavg
128
datavg2
256
datalvg39
128
rootvg
128
What I want is to have the result like this:
datavg 128
datavg2 256
datalvg39 128
rootvf 128
Does anyone have an idea how to do that ?
Thanks in advance for your help and your comprehension for my first script !