On 04.07.2021 20:10, John McCue wrote:
> Janis Papanagnou <
janis_pa...@hotmail.com> wrote:
>> The lack of a 'nullglob' feature in Kornshell made it necessary to use
>> clumsy workarounds (like file-testing on the [un-]expanded pattern).
>> The ksh93u+ (also ksh93u+m) seems not to have any supporting functions.
>> Is that observation correct? Are there any [nicer] workarounds?
>
> I can only guess what 'nullglob' is (never heard of it).
Sorry for not having explained that.
It's a shell option that you can activate in _bash_. If globbing is
activated - you can control that with the 'noglob' option that you
mention below - then any globbing pattern will expand to filenames
that match, unless there is no match, then the pattern will persist.
This is usually not what one wants. Activating the non-standard
option 'nullglob' will result in an empty list as expansion result
in that case of no matching files.
Janis
>
> But on AIX and OpenBSD ksh, you have 'set -o noglob' or
> command argument '-f'.
>
> Maybe that is the same as nullglob ?
The 'noglob' controls activation of file matching where globbing
characters are present, the 'nullglob' controls how the no-match
condition will be handled, unexpanded pattern vs. empty list.
Janis