Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

If it has syntax, it isn't user friendly.


devel / comp.unix.shell / [ksh] Availability of a 'nullglob' feature?

SubjectAuthor
* [ksh] Availability of a 'nullglob' feature?Janis Papanagnou
+* Re: [ksh] Availability of a 'nullglob' feature?marrgol
|`- Re: [ksh] Availability of a 'nullglob' feature?Janis Papanagnou
`* Re: [ksh] Availability of a 'nullglob' feature?John McCue
 `* Re: [ksh] Availability of a 'nullglob' feature?Janis Papanagnou
  `- Re: [ksh] Availability of a 'nullglob' feature?John McCue

1
[ksh] Availability of a 'nullglob' feature?

<sbps9g$9ul$1@news-1.m-online.net>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=4020&group=comp.unix.shell#4020

 copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.m-online.net!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: [ksh] Availability of a 'nullglob' feature?
Date: Sat, 3 Jul 2021 16:30:08 +0200
Organization: (posted via) M-net Telekommunikations GmbH
Lines: 6
Message-ID: <sbps9g$9ul$1@news-1.m-online.net>
NNTP-Posting-Host: 2001:a61:241e:cc01:5067:7de7:dfb1:4998
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: news-1.m-online.net 1625322608 10197 2001:a61:241e:cc01:5067:7de7:dfb1:4998 (3 Jul 2021 14:30:08 GMT)
X-Complaints-To: news@news-1.m-online.net
NNTP-Posting-Date: Sat, 3 Jul 2021 14:30:08 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
X-Mozilla-News-Host: news://news.m-online.net:119
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Sat, 3 Jul 2021 14:30 UTC

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?

Janis

Re: [ksh] Availability of a 'nullglob' feature?

<60e0e0b7$0$538$65785112@news.neostrada.pl>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=4021&group=comp.unix.shell#4021

 copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail
Subject: Re: [ksh] Availability of a 'nullglob' feature?
Newsgroups: comp.unix.shell
References: <sbps9g$9ul$1@news-1.m-online.net>
From: marr...@address.invalid (marrgol)
Date: Sun, 4 Jul 2021 00:12:07 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
Thunderbird/52.9.1
MIME-Version: 1.0
In-Reply-To: <sbps9g$9ul$1@news-1.m-online.net>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-GB
Content-Transfer-Encoding: 7bit
Lines: 14
Message-ID: <60e0e0b7$0$538$65785112@news.neostrada.pl>
Organization: Telekomunikacja Polska
NNTP-Posting-Host: 176.111.237.144
X-Trace: 1625350327 unt-rea-a-02.news.neostrada.pl 538 176.111.237.144:60396
X-Complaints-To: abuse@news.neostrada.pl
 by: marrgol - Sat, 3 Jul 2021 22:12 UTC

On 2021-07-03 at 16:30, Janis Papanagnou 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 think you could try sub-patterns (see man page), e.g. using
'~(N)*.txt' or ~(N:*.txt) pattern instead of '*.txt' for filename
generation returns an empty list instead of literal '*.txt' when
there's no file or directory ending with '.txt' available.

--
mrg

Re: [ksh] Availability of a 'nullglob' feature?

<sbqq93$in8$1@news-1.m-online.net>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=4023&group=comp.unix.shell#4023

 copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.mixmin.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.m-online.net!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: [ksh] Availability of a 'nullglob' feature?
Date: Sun, 4 Jul 2021 01:01:55 +0200
Organization: (posted via) M-net Telekommunikations GmbH
Lines: 19
Message-ID: <sbqq93$in8$1@news-1.m-online.net>
References: <sbps9g$9ul$1@news-1.m-online.net>
<60e0e0b7$0$538$65785112@news.neostrada.pl>
NNTP-Posting-Host: 2001:a61:241e:cc01:5067:7de7:dfb1:4998
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: news-1.m-online.net 1625353315 19176 2001:a61:241e:cc01:5067:7de7:dfb1:4998 (3 Jul 2021 23:01:55 GMT)
X-Complaints-To: news@news-1.m-online.net
NNTP-Posting-Date: Sat, 3 Jul 2021 23:01:55 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
In-Reply-To: <60e0e0b7$0$538$65785112@news.neostrada.pl>
 by: Janis Papanagnou - Sat, 3 Jul 2021 23:01 UTC

On 04.07.2021 00:12, marrgol wrote:
> On 2021-07-03 at 16:30, Janis Papanagnou 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 think you could try sub-patterns (see man page), e.g. using
> '~(N)*.txt' or ~(N:*.txt) pattern instead of '*.txt' for filename
> generation returns an empty list instead of literal '*.txt' when
> there's no file or directory ending with '.txt' available.

Thanks, that's it.

Looking that up in the man page also lead me to the answer of another
pattern related question I had two months ago; thanks also for that. :-)

Janis

Re: [ksh] Availability of a 'nullglob' feature?

<sbstj0$huj$1@dont-email.me>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=4033&group=comp.unix.shell#4033

 copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jmc...@obsd2.mhome.org (John McCue)
Newsgroups: comp.unix.shell
Subject: Re: [ksh] Availability of a 'nullglob' feature?
Date: Sun, 4 Jul 2021 18:10:40 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <sbstj0$huj$1@dont-email.me>
References: <sbps9g$9ul$1@news-1.m-online.net>
Reply-To: jmclnx@SPAMisBADgmail.com
Injection-Date: Sun, 4 Jul 2021 18:10:40 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="83c6fdfde5acde14f0f7068f370b4f2c";
logging-data="18387"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+JWlk52PIhLprsCCLeJgEh"
User-Agent: tin/2.4.4-20191224 ("Millburn") (OpenBSD/6.9 (amd64))
Cancel-Lock: sha1:jOyCWH8rSF+zTEbaOeX9Utp465c=
X-OS-Version: OpenBSD 6.9 amd64
 by: John McCue - Sun, 4 Jul 2021 18:10 UTC

Janis Papanagnou <janis_papanagnou@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?
>
> Janis

I can only guess what 'nullglob' is (never heard of it).

But on AIX and OpenBSD ksh, you have 'set -o noglob' or
command argument '-f'.

Maybe that is the same as nullglob ?

Re: [ksh] Availability of a 'nullglob' feature?

<sbt1po$77k$1@news-1.m-online.net>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=4034&group=comp.unix.shell#4034

 copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!news.karotte.org!news.space.net!news.m-online.net!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: [ksh] Availability of a 'nullglob' feature?
Date: Sun, 4 Jul 2021 21:22:32 +0200
Organization: (posted via) M-net Telekommunikations GmbH
Lines: 33
Message-ID: <sbt1po$77k$1@news-1.m-online.net>
References: <sbps9g$9ul$1@news-1.m-online.net> <sbstj0$huj$1@dont-email.me>
NNTP-Posting-Host: 2001:a61:241e:cc01:28ff:8d60:b0bf:f2d7
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-Trace: news-1.m-online.net 1625426552 7412 2001:a61:241e:cc01:28ff:8d60:b0bf:f2d7 (4 Jul 2021 19:22:32 GMT)
X-Complaints-To: news@news-1.m-online.net
NNTP-Posting-Date: Sun, 4 Jul 2021 19:22:32 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
X-Enigmail-Draft-Status: N1110
In-Reply-To: <sbstj0$huj$1@dont-email.me>
 by: Janis Papanagnou - Sun, 4 Jul 2021 19:22 UTC

On 04.07.2021 20:10, John McCue wrote:
> Janis Papanagnou <janis_papanagnou@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

Re: [ksh] Availability of a 'nullglob' feature?

<sbv9qj$r0n$1@dont-email.me>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=4039&group=comp.unix.shell#4039

 copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jmc...@obsd2.mhome.org (John McCue)
Newsgroups: comp.unix.shell
Subject: Re: [ksh] Availability of a 'nullglob' feature?
Date: Mon, 5 Jul 2021 15:51:47 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <sbv9qj$r0n$1@dont-email.me>
References: <sbps9g$9ul$1@news-1.m-online.net> <sbstj0$huj$1@dont-email.me> <sbt1po$77k$1@news-1.m-online.net>
Reply-To: jmclnx@SPAMisBADgmail.com
Injection-Date: Mon, 5 Jul 2021 15:51:47 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="90dcc106da4b91d6b6de42a602e8e5bd";
logging-data="27671"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+E+Yr7xQNZWToeTIcW8CJV"
User-Agent: tin/2.4.4-20191224 ("Millburn") (OpenBSD/6.9 (amd64))
Cancel-Lock: sha1:d70kIyA0NDSFt5NKFghbHFkp7Qw=
X-OS-Version: OpenBSD 6.9 amd64
 by: John McCue - Mon, 5 Jul 2021 15:51 UTC

Janis Papanagnou <janis_papanagnou@hotmail.com> wrote:
> On 04.07.2021 20:10, John McCue wrote:
>> Janis Papanagnou <janis_papanagnou@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.

That is fine, I could have googled it but was lazy and did
not want to fire up Firefox.

But your explanation made more since then what I found in
google :)

<snip>

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor