[sf-lug] dpkg -l & COLUMNS, & shell and environment ...

Michael Paoli Michael.Paoli at cal.berkeley.edu
Wed Aug 2 19:20:17 PDT 2017


Ah, yes, good point - and that seems to ensure - with COLUMNS not set
in the environment, that not only will the fields not be truncated
(at least as far as I can tell), but dpkg -l still aligns the fields,
so one can select/process them with cut(1) or awk(1) or whatever.
Plus, I'm presuming, the output also won't be wider than necessary.

> From: "Daniel Gimpelevich" <daniel at gimpelevich.san-francisco.ca.us>
> Subject: Re: [sf-lug] dpkg -l & COLUMNS, & shell and environment ...
> Date: Wed, 02 Aug 2017 08:39:27 -0700

> On Wed, 2017-08-02 at 07:18 -0700, Michael Paoli wrote:
>> $ COLUMNS=300 dpkg -l | ...
>> when I want to reasonably ensure none of the output columns are
>> truncated due to output width constraints.
>
> While the above is simpler, piping it to cat is simply less typing.




More information about the sf-lug mailing list