Stephane Chazelas dixit:

>$ ./mksh -c 'echo "${1?}"'
>./mksh: : parameter null or not set

>Note how the name of the parameter is not there

Indeed. (Not exactly nice, but then, it’s not exactly
a regular parameter either.) I’ll look whether I can
improve this, thanks.

>Nobody would ever want to do that, but note how it's ambiguous
>as it could be seen as ${#var} or as ${var?}.

I vaguely recall a discussion on this (on the POSIX list, maybe?)
and we agreed that this is a user error.

>$ ./mksh -uc 'echo "${a}"'
>./mksh: a: parameter not set
>$ ./mksh -c 'echo "${a?}"'
>./mksh: a: parameter null or not set
>
>The message is a bit misleading, you wouldn't get that message

Right, but it’s also used for the ${a:?} case where it’s correct.
I remember looking into this but deciding to keep the current
message for some reason.

>$ ./mksh -uc 'echo "${*:?}"' mksh ""
>zsh: segmentation fault  ./mksh -uc 'echo "${*:?}"' mksh ""
>$ ./mksh -uc 'echo "${@:?}"' mksh ""
>zsh: segmentation fault  ./mksh -uc 'echo "${@:?}"' mksh ""

I can reproduce these, thanks for reporting.

bye,
//mirabilos
-- 
Stéphane, I actually don’t block Googlemail, they’re just too utterly
stupid to successfully deliver to me (or anyone else using Greylisting
and not whitelisting their ranges). Same for a few other providers such
as Hotmail. Some spammers (Yahoo) I do block.

Reply via email to