mint-bash weirdness

Giles Orr gilesorr-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Fri Jan 3 22:39:09 UTC 2014


On 3 January 2014 17:22, D. Hugh Redelmeier <hugh-pmF8o41NoarQT0dZR+AlfA at public.gmane.org> wrote:

> | From: Giles Orr <gilesorr-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>
>
> | function dpkgs () { dpkg-query -W
> | --showformat='${Installed-Size}\t${Package}\n' | sort -n; }
> |
> |   No problem with Debian, I just drop the
> | function into /etc/bash.bashrc as usual.  But on Mint it just prints:
> |
> | Size
> | Size
> | Size
>
> [all the following is unreliable guess-work.]
>
> Shell variables don't normally had - in them.  Try the following:
>         echo ${yuck-zop}
> That should print "zop".  I think that this is an undocumented
> backward compatability feature of bash.  See sh(1), page 159, in
>   <http://plan9.bell-labs.com/7thEdMan/v7vol1.pdf>
>
> Now your usage should not involve shell parameter substitution but
> dpkg-query --showformat substitution.  But if the single quotes were
> somehow eaten, the shell would do the substitution and "Size" would be
> printed.
>
> If you do the command
>         set | less
> and search for dpkgs, you should see what definition bash has.
>
> I see:
>     dpkgs ()
>     {
>         dpkg-query -W --showformat='${Installed-Size}\t${Package}\n' |
> sort -n
>     }
> which looks correct (see the quotes?).
>
> I suspect that on the problematic system (Mint), those quotes are gone.
>

With sincere apologies ... I've rebooted the Vbox, and now it works.  I
have no explanation.  I reloaded and retried six ways from Sunday with no
luck prior to the reboot.  Probably stupidity on my part, but it must have
been a particularly clever brand of stupidity because I can't see what it
was.  <sigh>  Sorry for the wasted time ...

-- 
Giles
http://www.gilesorr.com/
gilesorr-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gtalug.org/pipermail/legacy/attachments/20140103/ab261987/attachment.html>


More information about the Legacy mailing list