[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: About /var/log/dpgk.log



On 2020-07-27 at 10:37, The Wanderer wrote:

> What you want to do instead is to run this exact latter command, and
> pass the output of that into the 'aptitude purge' command.

> Try:
> 
> $ aptitude purge $(grep "2020-07-23.*.install " /var/log/dpkg.log | awk
> '{ print $4 }' | tr '\n' ' ')
> 
> and see what you get.

Turns out that the 'tr' part can be dropped as well; the subshell
redirection is smart enough for the newlines to be processed correctly.
All you need to do with the output from grep is reduce it to only column 4.

I habitually do that via e.g. "cut -d ' ' -f 4" instead of "awk {print
$4}", but the result should be the same, and awk is more versatile.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: