Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Mausoleum: The final and funniest folly of the rich. -- Ambrose Bierce


devel / comp.unix.programmer / Re: Piping to stdin

SubjectAuthor
* Piping to stdinKenny McCormack
+* Piping to stdinKaz Kylheku
|+- Piping to stdinPhil Carmody
|`* Piping to stdinKeith Thompson
| `* Piping to stdinKaz Kylheku
|  `- Piping to stdinBen Bacarisse
`- Piping to stdinJim Jackson

1
Re: Piping to stdin

<ubbugh$3hium$2@news.xmission.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Piping to stdin
Date: Mon, 14 Aug 2023 01:03:13 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <ubbugh$3hium$2@news.xmission.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com> <mc7CM.741128$GMN3.387092@fx16.iad> <87r0o6mqme.fsf@nosuchdomain.example.com>
Injection-Date: Mon, 14 Aug 2023 01:03:13 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="3722198"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Mon, 14 Aug 2023 01:03 UTC

In article <87r0o6mqme.fsf@nosuchdomain.example.com>,
Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
>scott@slp53.sl.home (Scott Lurndal) writes:
>[...]
>> Most programs in unix will accept '-?' or '-h' or some other flag
>> to indicate that usage information is to be printed. Many utilities
>> will print usage information if the input arguments are not valid.
>
>Most Unix programs don't use '-?' because '?' is a shell wildcard
>character. If you happen to have files in the current directory named
>"-x" and "-y", "myprogram -?" expands to "myprogram -x -y".

Indeed - and this is one of the many reasons why insisting on an option
(any option) to get help is a bad idea. Given that -? is kind of a
standard in the Windows world, many programs that get ported over to
Unix from Windows, will have this misfeature.

--
Modern Conservative: Someone who can take time out from demanding more
flag burning laws, more abortion laws, more drug laws, more obscenity
laws, and more police authority to make warrantless arrests to remind
us that we need to "get the government off our backs".

Re: Piping to stdin

<20230813201038.114@kylheku.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Piping to stdin
Date: Mon, 14 Aug 2023 04:00:49 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <20230813201038.114@kylheku.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<mc7CM.741128$GMN3.387092@fx16.iad>
<87r0o6mqme.fsf@nosuchdomain.example.com>
<ubbugh$3hium$2@news.xmission.com>
Injection-Date: Mon, 14 Aug 2023 04:00:49 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e46a56cd35364bd395dd3d3fbcbd4bf2";
logging-data="2292814"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+aV1nW/ZBCDDgjSfNdnK9lxDf3VTGvX5E="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:D41wivMjvKwIE5Agj/jQ484p1eo=
 by: Kaz Kylheku - Mon, 14 Aug 2023 04:00 UTC

On 2023-08-14, Kenny McCormack <gazelle@shell.xmission.com> wrote:
> In article <87r0o6mqme.fsf@nosuchdomain.example.com>,
> Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
>>scott@slp53.sl.home (Scott Lurndal) writes:
>>[...]
>>> Most programs in unix will accept '-?' or '-h' or some other flag
>>> to indicate that usage information is to be printed. Many utilities
>>> will print usage information if the input arguments are not valid.
>>
>>Most Unix programs don't use '-?' because '?' is a shell wildcard
>>character. If you happen to have files in the current directory named
>>"-x" and "-y", "myprogram -?" expands to "myprogram -x -y".
>
> Indeed - and this is one of the many reasons why insisting on an option
> (any option) to get help is a bad idea. Given that -? is kind of a
> standard in the Windows world, many programs that get ported over to
> Unix from Windows, will have this misfeature.

Many command-line programs get ported to Unix from Windows?

Why don't they adjust their conventions?

/X /Y /Z /? is another convention; that one is smarter.

The system installation can arrange for the first three not
to be paths, and for /? not to match anything due to there
not being a one-character item in the root dir.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: Piping to stdin

<87o7ja3rpp.fsf@fatphil.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: pc+use...@asdf.org (Phil Carmody)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Piping to stdin
Date: Mon, 14 Aug 2023 12:20:50 +0300
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <87o7ja3rpp.fsf@fatphil.org>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<mc7CM.741128$GMN3.387092@fx16.iad>
<87r0o6mqme.fsf@nosuchdomain.example.com>
<ubbugh$3hium$2@news.xmission.com> <20230813201038.114@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="3b75e13a62fc21aed83b06f34f572f82";
logging-data="2375925"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196saGomBbXorBPICbH5OTp"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:85bZzy4QwAL2GB909AMhdKklb8I=
sha1:EHUwRx5ER0Tz7YuBmWuyD5aRDQc=
 by: Phil Carmody - Mon, 14 Aug 2023 09:20 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:
> On 2023-08-14, Kenny McCormack <gazelle@shell.xmission.com> wrote:
>> In article <87r0o6mqme.fsf@nosuchdomain.example.com>,
>> Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
>>>scott@slp53.sl.home (Scott Lurndal) writes:
>>>[...]
>>>> Most programs in unix will accept '-?' or '-h' or some other flag
>>>> to indicate that usage information is to be printed. Many utilities
>>>> will print usage information if the input arguments are not valid.
>>>
>>>Most Unix programs don't use '-?' because '?' is a shell wildcard
>>>character. If you happen to have files in the current directory named
>>>"-x" and "-y", "myprogram -?" expands to "myprogram -x -y".
>>
>> Indeed - and this is one of the many reasons why insisting on an option
>> (any option) to get help is a bad idea. Given that -? is kind of a
>> standard in the Windows world, many programs that get ported over to
>> Unix from Windows, will have this misfeature.
>
> Many command-line programs get ported to Unix from Windows?
>
> Why don't they adjust their conventions?
>
> /X /Y /Z /? is another convention; that one is smarter.
>
> The system installation can arrange for the first three not
> to be paths, and for /? not to match anything due to there
> not being a one-character item in the root dir.

So if I want to grep case-insensitively for whole words, and have line
numbers printed with the matched lines - in other words, on the unix
version I'm doing ``grep -win ...'' - should my system installation
arrange for /win to not be a path?

Phil
--
We are no longer hunters and nomads. No longer awed and frightened, as we have
gained some understanding of the world in which we live. As such, we can cast
aside childish remnants from the dawn of our civilization.
-- NotSanguine on SoylentNews, after Eugen Weber in /The Western Tradition/

Re: Piping to stdin

<87il9ilzzq.fsf@nosuchdomain.example.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Piping to stdin
Date: Mon, 14 Aug 2023 02:44:41 -0700
Organization: None to speak of
Lines: 40
Message-ID: <87il9ilzzq.fsf@nosuchdomain.example.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<mc7CM.741128$GMN3.387092@fx16.iad>
<87r0o6mqme.fsf@nosuchdomain.example.com>
<ubbugh$3hium$2@news.xmission.com> <20230813201038.114@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="bc618e44e086a302991f1b359b3157e4";
logging-data="2376054"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+BPemSdzRFp68Z2Rn6Rg0p"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:I3nI4CD/RowqTh5/rDy9Ju/CM7A=
sha1:Wy1Ul051dbenS6d2gsV0eA9LfZU=
 by: Keith Thompson - Mon, 14 Aug 2023 09:44 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:
> On 2023-08-14, Kenny McCormack <gazelle@shell.xmission.com> wrote:
>> In article <87r0o6mqme.fsf@nosuchdomain.example.com>,
>> Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
>>>scott@slp53.sl.home (Scott Lurndal) writes:
>>>[...]
>>>> Most programs in unix will accept '-?' or '-h' or some other flag
>>>> to indicate that usage information is to be printed. Many utilities
>>>> will print usage information if the input arguments are not valid.
>>>
>>>Most Unix programs don't use '-?' because '?' is a shell wildcard
>>>character. If you happen to have files in the current directory named
>>>"-x" and "-y", "myprogram -?" expands to "myprogram -x -y".
>>
>> Indeed - and this is one of the many reasons why insisting on an option
>> (any option) to get help is a bad idea. Given that -? is kind of a
>> standard in the Windows world, many programs that get ported over to
>> Unix from Windows, will have this misfeature.
>
> Many command-line programs get ported to Unix from Windows?
>
> Why don't they adjust their conventions?
>
> /X /Y /Z /? is another convention; that one is smarter.
>
> The system installation can arrange for the first three not
> to be paths, and for /? not to match anything due to there
> not being a one-character item in the root dir.

Having a program misbehave because there happens to be a one-character
item in the root directory is a bad idea. (For example, on Cygwin I
often make /c a symlink to /cygdrive/c for convenience.)

Also, some shells, either by default or depending on options, will print
an error message if a wildcard fails to match.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: Piping to stdin

<20230814084006.350@kylheku.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Piping to stdin
Date: Mon, 14 Aug 2023 15:49:21 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 53
Message-ID: <20230814084006.350@kylheku.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<mc7CM.741128$GMN3.387092@fx16.iad>
<87r0o6mqme.fsf@nosuchdomain.example.com>
<ubbugh$3hium$2@news.xmission.com> <20230813201038.114@kylheku.com>
<87il9ilzzq.fsf@nosuchdomain.example.com>
Injection-Date: Mon, 14 Aug 2023 15:49:21 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e46a56cd35364bd395dd3d3fbcbd4bf2";
logging-data="2510549"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+uFG6rPg38ewStsaInCVeKDYYOY5Q91mI="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:DieY8aT+tgmOZny0RDxX+enubpc=
 by: Kaz Kylheku - Mon, 14 Aug 2023 15:49 UTC

On 2023-08-14, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>> On 2023-08-14, Kenny McCormack <gazelle@shell.xmission.com> wrote:
>>> In article <87r0o6mqme.fsf@nosuchdomain.example.com>,
>>> Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
>>>>scott@slp53.sl.home (Scott Lurndal) writes:
>>>>[...]
>>>>> Most programs in unix will accept '-?' or '-h' or some other flag
>>>>> to indicate that usage information is to be printed. Many utilities
>>>>> will print usage information if the input arguments are not valid.
>>>>
>>>>Most Unix programs don't use '-?' because '?' is a shell wildcard
>>>>character. If you happen to have files in the current directory named
>>>>"-x" and "-y", "myprogram -?" expands to "myprogram -x -y".
>>>
>>> Indeed - and this is one of the many reasons why insisting on an option
>>> (any option) to get help is a bad idea. Given that -? is kind of a
>>> standard in the Windows world, many programs that get ported over to
>>> Unix from Windows, will have this misfeature.
>>
>> Many command-line programs get ported to Unix from Windows?
>>
>> Why don't they adjust their conventions?
>>
>> /X /Y /Z /? is another convention; that one is smarter.
>>
>> The system installation can arrange for the first three not
>> to be paths, and for /? not to match anything due to there
>> not being a one-character item in the root dir.
>
> Having a program misbehave because there happens to be a one-character
> item in the root directory is a bad idea.

But the problem of wildcard expansion producing that by accident
seems very improbable.

The * pattern won't expand to anything that has a leading slash. You
would have to explicitly do

utility /*

where /* expands to a set of paths the first of which (and possibly
others) look like an option. I don't think that's super common
compared to *.

This seems like less of a threat than

utility *

expanding to arguments that look like - options.

I would also disallow clumping options like /abc instead
of /a /b /c, so the clashing namespace is just one character.

Re: Piping to stdin

<87sf8lha03.fsf@bsb.me.uk>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Piping to stdin
Date: Mon, 14 Aug 2023 17:19:40 +0100
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <87sf8lha03.fsf@bsb.me.uk>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<mc7CM.741128$GMN3.387092@fx16.iad>
<87r0o6mqme.fsf@nosuchdomain.example.com>
<ubbugh$3hium$2@news.xmission.com> <20230813201038.114@kylheku.com>
<87il9ilzzq.fsf@nosuchdomain.example.com>
<20230814084006.350@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="4e833c0d8d6fa2b52032f5fcbebcc039";
logging-data="2525124"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+gDI9IzvvQxXDsXQoa/bnnlix0yVijWIA="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:eBuZzz4YfbR8P9KQT4eC/DhuylE=
sha1:7vvpNWecz9J+BPqbxInyMsi6CiA=
X-BSB-Auth: 1.1db6821c061e24515e8f.20230814171940BST.87sf8lha03.fsf@bsb.me.uk
 by: Ben Bacarisse - Mon, 14 Aug 2023 16:19 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:

> On 2023-08-14, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
>> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>>> On 2023-08-14, Kenny McCormack <gazelle@shell.xmission.com> wrote:
>>>> In article <87r0o6mqme.fsf@nosuchdomain.example.com>,
>>>> Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
>>>>>scott@slp53.sl.home (Scott Lurndal) writes:
>>>>>[...]
>>>>>> Most programs in unix will accept '-?' or '-h' or some other flag
>>>>>> to indicate that usage information is to be printed. Many utilities
>>>>>> will print usage information if the input arguments are not valid.
>>>>>
>>>>>Most Unix programs don't use '-?' because '?' is a shell wildcard
>>>>>character. If you happen to have files in the current directory named
>>>>>"-x" and "-y", "myprogram -?" expands to "myprogram -x -y".
>>>>
>>>> Indeed - and this is one of the many reasons why insisting on an option
>>>> (any option) to get help is a bad idea. Given that -? is kind of a
>>>> standard in the Windows world, many programs that get ported over to
>>>> Unix from Windows, will have this misfeature.
>>>
>>> Many command-line programs get ported to Unix from Windows?
>>>
>>> Why don't they adjust their conventions?
>>>
>>> /X /Y /Z /? is another convention; that one is smarter.
>>>
>>> The system installation can arrange for the first three not
>>> to be paths, and for /? not to match anything due to there
>>> not being a one-character item in the root dir.
>>
>> Having a program misbehave because there happens to be a one-character
>> item in the root directory is a bad idea.
>
> But the problem of wildcard expansion producing that by accident
> seems very improbable.
>
> The * pattern won't expand to anything that has a leading slash. You
> would have to explicitly do
>
> utility /*
>
> where /* expands to a set of paths the first of which (and possibly
> others) look like an option.

But you are suggesting users type /? for help. That could match a file
and produce almost any other flag as a result. I suspect that was
Keith's main concern.

> I would also disallow clumping options like /abc instead
> of /a /b /c, so the clashing namespace is just one character.

You could (as world king) disallow combining flags with the '-'
convention as well. You /have/ to with the '/' convention which makes
it /less/ smart in my book.

--
Ben.

Re: Piping to stdin

<slrnudkokv.7u3.jj@iridium.wf32df>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jj...@franjam.org.uk (Jim Jackson)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Piping to stdin
Date: Mon, 14 Aug 2023 17:21:35 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <slrnudkokv.7u3.jj@iridium.wf32df>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<mc7CM.741128$GMN3.387092@fx16.iad>
<87r0o6mqme.fsf@nosuchdomain.example.com>
<ubbugh$3hium$2@news.xmission.com>
Injection-Date: Mon, 14 Aug 2023 17:21:35 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3cec6dc63975a1866e544d510833373c";
logging-data="2539876"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ZbUPM4aslQfftB8jdwuz0W3mnyqlCBFE="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:ojPIftTirJsQlUpGNjhWOuetLWg=
 by: Jim Jackson - Mon, 14 Aug 2023 17:21 UTC

> .... Given that -? is kind of a
> standard in the Windows world, many programs that get ported over to
> Unix from Windows, will have this misfeature.
>

Command line programs ported from Windows to Unix !!!!! Sounds like an
oxymoron to me :-)

Do you have some in mind?

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor