Getting tired of cut-and-paste...so I thought I would post a question.
how do I change this column output to a single row?
from this:
# vgdisplay -v /dev/vgeva05 | grep dsk | awk '{print $3}'
/dev/dsk/c6t0d5
/dev/dsk/c11t0d5
/dev/dsk/c15t0d5
/dev/dsk/c18t0d5
/dev/dsk/c7t0d5
/dev/dsk/c10t0d5
/dev/dsk/c14t0d5
to this:
/dev/dsk/c6t0d5 /dev/dsk/c11t0d5 /dev/dsk/c15t0d5 /dev/dsk/c18t0d5 /dev/dsk/c7t0d5 /dev/dsk/c10t0d5 /dev/dsk/c14t0d5
any assistance would be appreciated...
manny
The easiest way:
# vgdisplay -v /dev/vgeva05 | grep dsk | awk '{print $3}' | tr "\n" " "
methyl
3
One way: Purists will note that I output a spurious trailing space.
OUTPUT=""
vgdisplay -v /dev/vgeva05 |grep "/dev/dsk"|awk '{print $3}'|while read DSK
do
OUTPUT="${OUTPUT}${DSK} "
done
echo "${OUTPUT}"
also found another option w/out the trailing space:
$ vgdisplay -v /dev/vgeva05 | awk '{print $3}' | awk 'END {print line} /dsk/ { line = line " " $0 }'
/dev/dsk/c6t0d5 /dev/dsk/c11t0d5 /dev/dsk/c15t0d5 /dev/dsk/c18t0d5 /dev/dsk/c7t0d5 /dev/dsk/c10t0d5 /dev/dsk/c14t0d5 /dev/dsk/c19t0d5
thanks for the replies 
manny
methyl
5
The one without the trailing space has a leading space !
ooops, sorry.
another variation:
$ vgdisplay -v /dev/vgeva05 | awk 'END {print line} /dsk/ { line = line " " $3 }'
/dev/dsk/c6t0d5 /dev/dsk/c11t0d5 /dev/dsk/c15t0d5 /dev/dsk/c18t0d5 /dev/dsk/c7t0d5 /dev/dsk/c10t0d5 /dev/dsk/c14t0d5 /dev/dsk/c19t0d5
Without leading or trailing space:
vgdisplay -v /dev/vgeva05 |
awk '/dsk/{
if (NR==1) {
printf $3
next
}
printf " " $3
}
END{print ""}
'
But with an extra pv at the start 
awk '/dsk/{p=p$3FS}END{sub(/ $/,"",p);print p}'
Good catch ;), corrected the code.