Help with an awk command
- From: Matthew Kruer <mkruer@xxxxxxxxx>
- Date: Thu, 17 May 2012 12:25:27 -0700 (PDT)
Instead of going for a overly complicated grep/sed/stat/find commands, is there a way to use awk to break the file name into the required string groups in a single shot? yea I being lazy by asking.
rpm1_1-188.8.131.52-1.noarch.rpm (assuming later timestamps the the file above)
Expected output (filename, version, arch)
rpm 184.108.40.206-10 x86_64
rpm1_1 220.127.116.11-1 noarch
rpm3-next 18.104.22.168-1 noarch
I was using "find *.rpm | sed 's/-[0-9].*//'" to get just the rpm name.
Thanks in advance