On Thu, Apr 07, 2016 at 11:49:05AM +1000, Cameron Simpson wrote:
> On 06Apr2016 19:33, derek martin <inva...@pizzashack.org> wrote:
> >Then again, maybe I did know that once--my
> >memory chips have become increasingly faulty with age. ;-)
> 
> Me too. I am further hampered by little "calendar" time sense; other
> people can say "oh this happened in 2001", I have no idea and have
> to reference wrt to specific events in my memory, hoping they have
> dates associated.

I've yet to notice any of the so-called benefits of getting older,
that people sometimes extoll... 

> Probably fixed in modern interactive shells. Note your test is
> testing your interactive shell, not /bin/sh (if they're different).

On the system I ran the test on, they happen to be the same.  On other
systems I use /bin/sh is dash, but I believe it behaves the same.
My sysadmin background has led me to think that you should always just
use the system default shell, because it's pretty much always going to
be available unless the system is completely unusable, and because
perhaps there's a good reason it's the default. ;-)  Though, the
switch in many Linux distros to dash as the system shell has somewhat
thwarted me--dash isn't (IMO) usable as an interactive shell, has some
issues as a scripting shell, and has slightly different semantics (BSD
vs.  SysV echo, for instance) than bash on some oft-used builtins,
etc..  I find this extremely annoying.  I get why they did it, but I
think it would have been a much better idea to produce a
bash-workalike shell for the subset of features they wanted to
support.  Or patch dash to behave the same where its supported
features differ.  Anyway, I digress.

FWIW I haven't been at it quite as long as you, evidently, but I've
been writing shell scripts for about 25 years on maybe 8 different
platforms, and I've never encountered the bug you describe...  I
didn't know about (or remember) the ${x:+y} syntax though, so just
goes to show there's always something to (re)learn, no matter how long
you've been at it.  =8^)

-- 
Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.

Attachment: pgpXGaikiPSHQ.pgp
Description: PGP signature

Reply via email to