Hi All,
i am trying to print the solaris 11 packages in below required format, But i am unable to do that.
Current ouput :
root@abc# pkginfo -l | egrep '(BASEDIR|NAME|VERSION)' | awk '{print}'
NAME: QLogic 570x/571x Gigabit Ethernet Driver
VERSION: 11.11,REV=2009.11.11
BASEDIR: /
NAME: QLogic 57xxx 10/20GbE NIC Driver
VERSION: 11.11,REV=2009.11.11
BASEDIR: /
NAME: HP Smart Array HBA Driver 2.4.4.1
VERSION: 11.11,REV=2009.11.11
BASEDIR: /
NAME: cas_migrateconf - The migrateconf class action script for CSW packages
VERSION: 1.50,REV=2015.01.17
BASEDIR: /
NAME: cas_preserveconf - The preserveconf class action script for CSW packages
VERSION: 1.50,REV=2015.01.17
BASEDIR: /
NAME: common - common files and dirs for CSW packages
VERSION: 1.5,REV=2010.12.11
BASEDIR: /
NAME: ggettext_data - GNU locale utilities, translation files
VERSION: 0.19.8,REV=2016.09.08
BASEDIR: /
NAME: iconv_stub - Transitional package. Content moved to CSWlibcharset1 CSWlibiconv2
VERSION: 1.14,REV=2011.08.08
BASEDIR: /
NAME: jq - A lightweight and flexible command-line JSON processor.
VERSION: 1.4,REV=2014.09.07
BASEDIR: /
NAME: libbz2_1_0 - Compression library, libbz2.so.1.0
VERSION: 1.0.6,REV=2011.08.18
BASEDIR: /
NAME: libcharset1 - GNU iconv charset library, libcharset.so.1
VERSION: 1.14,REV=2011.08.07
BASEDIR: /
NAME: libiconv2 - GNU iconv library, libiconv.so.2
VERSION: 1.14,REV=2011.08.07
BASEDIR: /
NAME: libidn11 - GNU IDN library, libidn.so.11
VERSION: 1.33,REV=2016.09.05
BASEDIR: /
Desired output :
{"NAME": "QLogic 570x/571x Gigabit Ethernet Driver",
"VERSION": "11.11,REV=2009.11.11",
"BASEDIR": "/"},
{ "NAME": "QLogic 57xxx 10/20GbE NIC Driver",
"VERSION": "11.11,REV=2009.11.11",
"BASEDIR": "/"}
i tried to convert rows to column but with awk filter i am not able to print required fields data
Can someone please help me on this issue.
1)paste - - - < out
2)with awk syntax i am unable to print entire package name.