Date:        Sat, 27 Sep 2025 13:56:53 +0100
    From:        Ralph Corderoy <[email protected]>
    Message-ID:  <[email protected]>


  | ‘t=${t%.${suf}}’ will interpret globs in $suf,

Yes, but

        t=${t%".${suf}"}

doesn't, if that was ever likely (or perhaps, just possibly)
an issue.  But yes, in the context in which that was used,
just using .* as the pattern to remove would work just as well.
(I tend to prefer to be explicit when I can, using '*' in glob
tends to make the matching slower in most implementations, not
that anyone is ever likely to be able to measure the difference
in these simple cases.)

  | If out of memory, I'd like to stop rather than push on with bad data.

If a shell (any of them) runs out of memory, it will stop, you get
no choice in the matter - there's nothing you can do about it, or
test for.   A non-interactive shell will just stop everything and
exit, an interactive one will usually stop everything it is doing
and return to the command prompt (but exiting is not impossible there
either).   But you typically need to work very hard to run a shell on
a modern processor out of memory.

  | The ‘${t?}’ tests fail, not that I wrote one of those.  ‘d=~’ is
  | unspecified if $HOME isn't set, and ‘d=~foo’ undefined if the login name
  | is unknown.

Not undefined, just unspecified, and I think most shells just leave the
~foo alone if foo is not a valid login name.   For d=~ if HOME is not
set, I think most shells will getpwent(getuid()) and use the home from
there, if possible.   But you're right, both of those are unspecified.

I'm not sure what context is for that paragraph however, you're obviously
considering something I am unaware of.   (I don't use mhstore much, I tend
to process messages with attachments using exmh).

kre


Reply via email to