[sf-lug] NEED INFO ABOUT BOOT SECTOR, SPACE LIMITS

Rick Moen rick at linuxmafia.com
Wed Aug 2 10:21:25 PDT 2017


Quoting Alex Kleider (akleider at sonic.net):

> My understanding of Bash leads me to believe that the first part
> simply re-assigns an env var to itself (COLUMNS) but I don't
> understand how it fits with the rest.  I would have expected a
> syntax error: no ';' between statements.

I'm not totally sure why it works, either, Alex, but indeed it sets a
local environment variable that dpkg then heeds when it starts up and
parses its environment.

I claim no deep insight; it's just one of those tricks I picked up along
the way, probably from the dpkg(1) man page:

  ENVIRONMENT
  [,,.]

  COLUMNS

     Sets the number of columns dpkg should use when displaying formatted
     text. Currently only used by -l.

So, it was -- more than likely -- just a classic case of my reading 'Do
this - it works' and doing monkey see, monkey do.  And here we are.  ;->

Why isn't the local variable set & then used by doing the more usual...

   COLUMNS=132; dpkg -l

...?

It's some kind of shell fine point.  If you do it just as a prefix to 
a command rather than stringing separate commands using ';' or '&&',
then you're setting the environment for the child process (in this case,
dpkg) only, and not for the shell itself.


That's my rough understanding.  If we're lucky, Michael P. will bestow a
learned two-page treatise on the subject.  ;->  (I suspect he might have
been up late migrating BALUG's mailing lists.)



More information about the sf-lug mailing list