cat pkg.temp
ca-certificates-2017.2.14-65.0.1.el6_9.noarch
glusterfs-3.7.9-12.el6.x86_64
glusterfs-api-3.7.9-12.el6.x86_64
glusterfs-api-devel-3.7.9-12.el6.x86_64
glusterfs-client-xlators-3.7.9-12.el6.x86_64
Here is a file , I want the output as :
PkgName Version
ca-certificates 2017.2.14-65.0.1.el6_9.noarch
glusterfs 3.7.9-12.el6.x86_64
glusterfs-api-devel 3.7.9-12.el6.x86_64
glusterfs-client-xlators 3.7.9-12.el6.x86_64
This way I get unwanted hyphen at the last:
$ awk -F'[[:digit:]]' '{ print $1}'
ca-certificates-
glusterfs-
glusterfs-api-
glusterfs-api-devel-
glusterfs-client-xlators-
While printing $2 wont display my version either
awk -F'[[:digit:]]' '{ print $2}' /tmp/Version-pkgs
.
.
.
.
.
.