[Info-vax] Unix and DCL shells
Dan Cross
cross at spitfire.i.gajendra.net
Mon Jan 22 08:21:20 EST 2024
In article <8734up7v0v.fsf at eder.anydns.info>,
Andreas Eder <a_eder_muc at web.de> wrote:
>On Fr 12 Jan 2024 at 20:17, Lawrence D'Oliveiro <ldo at nz.invalid> wrote:
>
>> Ah, true. I suppose that could be added as a new kind of wildcard option
>> to the existing wildcard syntax. After all, there is no shortage of
>> characters that are currently illegal in filespecs, that could be used. ;)
>>
>> For those who are wondering about the usefulness of this on *nix systems,
>> here
>>
>> ls -ld ~/.[!.]*
>>
>> is a command to list all dotfiles/dotdirectories in my home directory.
>
>I think you meant
>
>> ls -ld ~/.[^.]*
The POSIX shell notation is kind of strange; it was, as I was
told, originally based on ksh88, which uses this notation for
negation in pattern matching. In particular, section 2.13.1 of
the current standard says that `!` takes the place of `^` in
shell pattern matching:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13
Beats me why Korn chose this syntax. Historically, the 7th
Edition shell by Bourne didn't support negation in patterns
at all.
- Dan C.
More information about the Info-vax
mailing list