On Sun, Dec 02, 2018 at 08:20:25PM +1100, David wrote: > On Wed, 28 Nov 2018 at 06:41, Roberto C. Sánchez <robe...@debian.org> wrote: > > > > apt-cache policy $(dpkg -l |grep libcurl | awk '{print $2}') > > Just FAWC (for anyone who cares :]) that's a UUOG (useless > use of grep), because regular expression support is fundamental > to the design of awk. > > apt-cache policy $(dpkg -l | awk '/libcurl/ {print $2}') > > would be a nicer way to do that, FAWC. >
I suppose I should know that. For the longest time I always did 'grep | cut' but kept encountering instances where I needed something a bit more flexible than cut. I found awk to my liking but never properly learned it, just always using it as a fancy cut replacement. Thanks for the pointer. Regards, -Roberto -- Roberto C. Sánchez