This works, but its messy. Any suggestions for a elegant solution? :-
me@myserver $ head zoneAttachOutfile
These packages installed on the source system are inconsistent with this system:
SUNWsmbac: version mismatch
(11.9.0,REV=2002.03.02.00.35)
(11.10.0,REV=2005.01.08.05.16)
SUNWsmbau: version mismatch
(11.9.0,REV=2002.03.02.00.35)
(11.10.0,REV=2005.01.08.05.16)
These packages installed on this system were not installed on the source system:
SUNWtcsh (11.10.0,REV=2005.01.08.05.16)
SUNWtltkm (3.7.2,REV=10.2004.12.17)
me@myserver $ pkgMismatched=SUNWsmbac ## later this will be a variable in a loop
me@myserver $ let reqVersionLine="`grep -n $pkgMismatched zoneAttachOutfile | head -1 | cut -f1 -d:`+2" ## resolves to 4 in above example
me@myserver $ requiredVersion=`sed -n "${reqVersionLine}p" zoneAttachOutfile | tr -d '()\t'`
me@myserver $ echo $requiredVersion
11.10.0,REV=2005.01.08.05.16
Regards Rep