<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 3 January 2014 17:22, D. Hugh Redelmeier <span dir="ltr"><<a href="mailto:hugh-pmF8o41NoarQT0dZR+AlfA@public.gmane.org" target="_blank">hugh-pmF8o41NoarQT0dZR+AlfA@public.gmane.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
| From: Giles Orr <<a href="mailto:gilesorr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org">gilesorr@gmail.com</a>><br>
<div class="im"><br>
| function dpkgs () { dpkg-query -W<br>
| --showformat='${Installed-Size}\t${Package}\n' | sort -n; }<br>
|<br>
</div><div class="im">|   No problem with Debian, I just drop the<br>
| function into /etc/bash.bashrc as usual.  But on Mint it just prints:<br>
|<br>
| Size<br>
| Size<br>
| Size<br>
<br>
</div>[all the following is unreliable guess-work.]<br>
<br>
Shell variables don't normally had - in them.  Try the following:<br>
        echo ${yuck-zop}<br>
That should print "zop".  I think that this is an undocumented<br>
backward compatability feature of bash.  See sh(1), page 159, in<br>
  <<a href="http://plan9.bell-labs.com/7thEdMan/v7vol1.pdf" target="_blank">http://plan9.bell-labs.com/7thEdMan/v7vol1.pdf</a>><br>
<br>
Now your usage should not involve shell parameter substitution but<br>
dpkg-query --showformat substitution.  But if the single quotes were<br>
somehow eaten, the shell would do the substitution and "Size" would be<br>
printed.<br>
<br>
If you do the command<br>
        set | less<br>
and search for dpkgs, you should see what definition bash has.<br>
<br>
I see:<br>
<div class="im">    dpkgs ()<br>
    {<br>
        dpkg-query -W --showformat='${Installed-Size}\t${Package}\n' | sort -n<br>
    }<br>
</div>which looks correct (see the quotes?).<br>
<br>
I suspect that on the problematic system (Mint), those quotes are gone.<br></blockquote><div> </div></div>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 ...<br clear="all">
</div><div class="gmail_extra"><br>-- <br>Giles<br><a href="http://www.gilesorr.com/">http://www.gilesorr.com/</a><br><a href="mailto:gilesorr@gmail.com">gilesorr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a>
</div></div>