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.
Directory Files
rpm-12.3.4.5-10.x86_64.rpm
rpm1_1-1.0.0.8-1.noarch.rpm
rpm1_1-1.0.0.9-1.noarch.rpm (assuming later timestamps the the file above)
rpm3-next-1.2.3.4-1.noarch.rpm
Expected output (filename, version, arch)
rpm 12.3.4.5-10 x86_64
rpm1_1 1.0.0.9-1 noarch
rpm3-next 1.2.3.4-1 noarch
I was using "find *.rpm | sed 's/-[0-9].*//'" to get just the rpm name.
Thanks in advance
.
- Follow-Ups:
- Re: Help with an awk command
- From: Ed Morton
- Re: Help with an awk command
- From: Arnaud Gomes-do-Vale
- Re: Help with an awk command
- From: Kenny McCormack
- Re: Help with an awk command
- Prev by Date: Re: Here Doc Trouble
- Next by Date: Re: Help with an awk command
- Previous by thread: Ruby/Perl Developer
- Next by thread: Re: Help with an awk command
- Index(es):