Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Avoid strange women and temporary variables.


devel / comp.lang.c / Re: Piping to stdin

SubjectAuthor
* Piping to stdinMalcolm McLean
+* Re: Piping to stdinSpiros Bousbouras
|`* Re: Piping to stdinMalcolm McLean
| +* Re: Piping to stdinBart
| |+* Re: Piping to stdinMalcolm McLean
| ||`- Re: Piping to stdinBart
| |`- Re: Piping to stdinScott Lurndal
| +- Re: Piping to stdinScott Lurndal
| +* Re: Piping to stdinLew Pitcher
| |`* Re: Piping to stdinKaz Kylheku
| | `- Re: Piping to stdinScott Lurndal
| +* Re: Piping to stdinBen Bacarisse
| |`- Re: Piping to stdinScott Lurndal
| `* Re: Piping to stdinKenny McCormack
|  +* Re: Piping to stdinKaz Kylheku
|  |`* Re: Piping to stdinKenny McCormack
|  | `* Re: Piping to stdinKalevi Kolttonen
|  |  `* Re: Piping to stdinGary R. Schmidt
|  |   +* Re: Piping to stdinKaz Kylheku
|  |   |+- Re: Piping to stdinKeith Thompson
|  |   |+* Re: Piping to stdinRichard Kettlewell
|  |   ||+- Dealing with weird filenames (Was: Piping to stdin)Kenny McCormack
|  |   ||+* Re: Piping to stdinDavid Brown
|  |   |||+* Re: Piping to stdinRichard Harnden
|  |   ||||+- Re: Piping to stdinScott Lurndal
|  |   ||||`- Re: Piping to stdinvallor
|  |   |||`* Re: Piping to stdinRichard Kettlewell
|  |   ||| `* Re: Piping to stdinScott Lurndal
|  |   |||  +- Re: Piping to stdinKenny McCormack
|  |   |||  +- Re: Piping to stdinKeith Thompson
|  |   |||  `- Re: Piping to stdinPhil Carmody
|  |   ||`* Re: Piping to stdinJames Kuyper
|  |   || `- Re: Piping to stdinDavid Brown
|  |   |`* Re: Piping to stdinJoe Pfeiffer
|  |   | `* Re: Piping to stdinRichard Harnden
|  |   |  `- Re: Piping to stdinPhil Carmody
|  |   `* Re: Piping to stdinKalevi Kolttonen
|  |    +* Re: Piping to stdinGiovanni
|  |    |`* Re: Piping to stdinKenny McCormack
|  |    | `* Re: Piping to stdinKalevi Kolttonen
|  |    |  +* Re: Piping to stdinMuttley
|  |    |  |+* Re: Piping to stdinKalevi Kolttonen
|  |    |  ||`* Re: Piping to stdinMuttley
|  |    |  || `* Re: Piping to stdinKalevi Kolttonen
|  |    |  ||  `- Re: Piping to stdinScott Lurndal
|  |    |  |+- Re: Piping to stdinKaz Kylheku
|  |    |  |`* Re: Piping to stdinPhil Carmody
|  |    |  | `* Re: Piping to stdinMuttley
|  |    |  |  +* Re: Piping to stdinPhil Carmody
|  |    |  |  |+* Re: Piping to stdinMichael S
|  |    |  |  ||`* Re: Piping to stdinAnton Shepelev
|  |    |  |  || +- Re: Piping to stdincandycanearter07
|  |    |  |  || `- Re: Piping to stdincandycanearter07
|  |    |  |  |+* Wrecking a good thing? (Was: Piping to stdin)Kenny McCormack
|  |    |  |  ||+- Re: Wrecking a good thing?Phil Carmody
|  |    |  |  ||`- Re: Wrecking a good thing? (Was: Piping to stdin)David Brown
|  |    |  |  |+- Re: Piping to stdinMuttley
|  |    |  |  |`- Re: Piping to stdinÖö Tiib
|  |    |  |  +* Re: Piping to stdinKaz Kylheku
|  |    |  |  |+- Re: Piping to stdinMuttley
|  |    |  |  |+- Re: Piping to stdinKeith Thompson
|  |    |  |  |`- Re: Piping to stdinDavid Brown
|  |    |  |  `* Re: Piping to stdinBen Bacarisse
|  |    |  |   `* Re: Piping to stdinPhil Carmody
|  |    |  |    +* Re: Piping to stdinOğuz
|  |    |  |    |`* Re: Piping to stdinMuttley
|  |    |  |    | +* Re: Piping to stdinScott Lurndal
|  |    |  |    | |`- Re: Piping to stdinMuttley
|  |    |  |    | `* Re: Piping to stdinRainer Weikusat
|  |    |  |    |  `* What language is this? (Was: Piping to stdin)Kenny McCormack
|  |    |  |    |   `* Re: What language is this? (Was: Piping to stdin)Scott Lurndal
|  |    |  |    |    +* Re: What language is this? (Was: Piping to stdin)Kenny McCormack
|  |    |  |    |    |`* Re: What language is this?Rainer Weikusat
|  |    |  |    |    | `* Re: What language is this?Kenny McCormack
|  |    |  |    |    |  `* Re: What language is this?Rainer Weikusat
|  |    |  |    |    |   `* Re: What language is this?Kenny McCormack
|  |    |  |    |    |    `- Re: What language is this?Rainer Weikusat
|  |    |  |    |    `- Re: What language is this? (Was: Piping to stdin)Muttley
|  |    |  |    `- Re: Piping to stdinBen Bacarisse
|  |    |  +* Re: Piping to stdinPhil Carmody
|  |    |  |`* Re: Piping to stdinLew Pitcher
|  |    |  | `* Re: Piping to stdinPhil Carmody
|  |    |  |  `* Re: Piping to stdinLew Pitcher
|  |    |  |   +- Re: Piping to stdinKaz Kylheku
|  |    |  |   `- Re: Piping to stdinPhil Carmody
|  |    |  `- Re: Piping to stdinBen Bacarisse
|  |    `- Re: Piping to stdinPhil Carmody
|  `- Re: Piping to stdinNuno Silva
+* Re: Piping to stdinScott Lurndal
|`* Re: Piping to stdinKeith Thompson
| `* Re: Piping to stdinKenny McCormack
|  +* Re: Piping to stdinKaz Kylheku
|  |+- Re: Piping to stdinPhil Carmody
|  |`* Re: Piping to stdinKeith Thompson
|  | +* Re: Piping to stdinMalcolm McLean
|  | |`- Re: Piping to stdinKenny McCormack
|  | `* Re: Piping to stdinKaz Kylheku
|  |  `- Re: Piping to stdinBen Bacarisse
|  `* Re: Piping to stdinJim Jackson
|   `- Re: Piping to stdinMichael S
+- Re: Piping to stdinJohn Forkosh
`* Re: Piping to stdinKenny McCormack

Pages:12345
Re: Piping to stdin

<ubghe4$2ubhu$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27715&group=comp.lang.c#27715

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: richard....@gmail.com (Richard Harnden)
Newsgroups: comp.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Tue, 15 Aug 2023 19:50:44 +0100
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <ubghe4$2ubhu$1@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<LtQSo3SOOU09AXJ1X@bongo-ra.co> <ubbua5$3hium$1@news.xmission.com>
<20230813200644.979@kylheku.com> <ubc63c$3hlul$2@news.xmission.com>
<ubdgcv$2carp$2@dont-email.me> <vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<20230814215312.550@kylheku.com> <wwvleeceobt.fsf@LkoBDZeT.terraraq.uk>
<ubfus8$2rc7s$1@dont-email.me>
Reply-To: nospam.harnden@gmail.com
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 15 Aug 2023 18:50:44 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a15a07fd2a1762fba1bf49304712c7a9";
logging-data="3092030"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+pnukHrBoLbqPqzHdp6hhUdp+nSKSFN6c="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.14.0
Cancel-Lock: sha1:DjrWRzZC46oECXl50/tBkSArq+M=
In-Reply-To: <ubfus8$2rc7s$1@dont-email.me>
 by: Richard Harnden - Tue, 15 Aug 2023 18:50 UTC

On 15/08/2023 14:34, David Brown wrote:
> On 15/08/2023 09:50, Richard Kettlewell wrote:
>> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>>> On 2023-08-15, Gary R. Schmidt <grschmidt@acm.org> wrote:
>>>> Ahah!  You don't have users, do you?
>>>>
>>>> No doubt you also don't encounter filenames with spaces in them, or
>>>> carriage returns, or other garbage.
>>>
>>> The interesction of:
>>>
>>> - Users who make filenames like "-foo" and "monthly forecast.xls"
>>>
>>> - Users who sit in a POSIX shell expanding wildcards like *
>>>    in the same directory.
>>>
>>> is probababy vanishingly nil, and the subset of those who do the
>>> above in the same directory is even smaller.
>>
>> The cases I’ve encountered are where someone accidentally creates a file
>> with a weird name (starts with - or whatever) and then has trouble
>> deleting it. I don’t think they got as far as having accidents with
>> wildcards in the cases I remember, but the basic setup of a file with a
>> ridiculous name and a non-expert user does happen occasionally.
>>
>
> It's usually sufficient just to put the awkward name inside quotation
> marks.
>
>

But people won't/don't do that.

Also:

$ >-f
$ >-r
$ rm *

How to safely cater for all 'weird' inputs?

Re: Piping to stdin

<o2RCM.110346$PlBb.53343@fx42.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27723&group=comp.lang.c#27723

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx42.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Piping to stdin
Newsgroups: comp.unix.programmer,comp.lang.c
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com> <LtQSo3SOOU09AXJ1X@bongo-ra.co> <ubbua5$3hium$1@news.xmission.com> <20230813200644.979@kylheku.com> <ubc63c$3hlul$2@news.xmission.com> <ubdgcv$2carp$2@dont-email.me> <vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au> <20230814215312.550@kylheku.com> <wwvleeceobt.fsf@LkoBDZeT.terraraq.uk> <ubfus8$2rc7s$1@dont-email.me> <ubghe4$2ubhu$1@dont-email.me>
Lines: 44
Message-ID: <o2RCM.110346$PlBb.53343@fx42.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 15 Aug 2023 20:16:20 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 15 Aug 2023 20:16:20 GMT
X-Received-Bytes: 2435
 by: Scott Lurndal - Tue, 15 Aug 2023 20:16 UTC

Richard Harnden <richard.nospam@gmail.com> writes:
>On 15/08/2023 14:34, David Brown wrote:
>> On 15/08/2023 09:50, Richard Kettlewell wrote:
>>> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>>>> On 2023-08-15, Gary R. Schmidt <grschmidt@acm.org> wrote:
>>>>> Ahah!  You don't have users, do you?
>>>>>
>>>>> No doubt you also don't encounter filenames with spaces in them, or
>>>>> carriage returns, or other garbage.
>>>>
>>>> The interesction of:
>>>>
>>>> - Users who make filenames like "-foo" and "monthly forecast.xls"
>>>>
>>>> - Users who sit in a POSIX shell expanding wildcards like *
>>>>    in the same directory.
>>>>
>>>> is probababy vanishingly nil, and the subset of those who do the
>>>> above in the same directory is even smaller.
>>>
>>> The cases I’ve encountered are where someone accidentally creates a file
>>> with a weird name (starts with - or whatever) and then has trouble
>>> deleting it. I don’t think they got as far as having accidents with
>>> wildcards in the cases I remember, but the basic setup of a file with a
>>> ridiculous name and a non-expert user does happen occasionally.
>>>
>>
>> It's usually sufficient just to put the awkward name inside quotation
>> marks.
>>
>>
>
>But people won't/don't do that.
>
>Also:
>
>$ >-f
>$ >-r
>$ rm *
>
>How to safely cater for all 'weird' inputs?

Well, like any tool, it can be misused. I don't blame
the tool for that, when the tool is still useful.

Re: Piping to stdin

<87sf8k2gw3.fsf@fatphil.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27725&group=comp.lang.c#27725

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
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.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Tue, 15 Aug 2023 23:24:28 +0300
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <87sf8k2gw3.fsf@fatphil.org>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<ubg25m$2rr3g$1@dont-email.me> <ubg4no$8kb$1@milena.home.net.it>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="9176dbab4427e178b28c3a609a56f3cb";
logging-data="3113645"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18cN8yV+28Rb54Ysg/XpPrl"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:XALYm39ifrrj+s5QaQDiquDMZC4=
sha1:jS1HVQuVZnC/SF8CGYNn4FViNwo=
 by: Phil Carmody - Tue, 15 Aug 2023 20:24 UTC

kalevi@kolttonen.fi (Kalevi Kolttonen) writes:
> Kenny McCormack <gazelle@shell.xmission.com> wrote:
>> But do they know that???
>
> "They" probably don't know it. But let's face it,
> nobody really wants to create a file having '-'
> filename on purpose. The filename is not descriptive
> at all, it would be just an insane choice for anything
> useful.
>
> It could happen by accident, but even that is quite
> unlikely.
>
> If "they" don't know how to delete it, there is no need
> to panic. The file's existence does no harm. "They" can
> always ask for help and someone will tell them how
> to get rid of it.
>
> I guess the stdin convention '-' is decades old.
> It was chosen because they had pick something that
> is short and not likely to exist as a real file.

I propose that '|' might have been better - it's even mnemonic.

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

<87o7j82gix.fsf@fatphil.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27729&group=comp.lang.c#27729

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
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.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Tue, 15 Aug 2023 23:32:22 +0300
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <87o7j82gix.fsf@fatphil.org>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<ubg25m$2rr3g$1@dont-email.me> <ubg4no$8kb$1@milena.home.net.it>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="9176dbab4427e178b28c3a609a56f3cb";
logging-data="3127462"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ZdG0yVe9y+mdzYYgdvBTQ"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:6R4WBsPcCGkxmq8qQ0xFHAsf3rs=
sha1:TV3sPED6yO6q0TXnu2FZbMYdjX4=
 by: Phil Carmody - Tue, 15 Aug 2023 20:32 UTC

Muttley@dastardlyhq.com writes:
> On Tue, 15 Aug 2023 16:12:19 -0000 (UTC)
> kalevi@kolttonen.fi (Kalevi Kolttonen) wrote:
>>Kenny McCormack <gazelle@shell.xmission.com> wrote:
>>> But do they know that???
>>
>>"They" probably don't know it. But let's face it,
>>nobody really wants to create a file having '-'
>>filename on purpose. The filename is not descriptive
>>at all, it would be just an insane choice for anything
>>useful.
>
> I used to think the same thing about spaces in filenames. Then along came
> Windows.

Your memory if flawed. Spaces were always allowed in unix
filenames. Often used to hide things in plain sight on FTP sites, for
example.

MS Windows didn't allow spaces until Windows 95. I remember the Apple
advert at the time - it was a double-page spread which basically just
said:

C:\NGRTLTNS.W95

in a gajillion-point high font. I pulled that out of a newspaper and
had it on my wall at work. Not because I was an Apple fanboi, far
from it, but my disdain for all things MS Windows was already
entrenched, and I was being forced to use it for the not-the-actual-work
part of my job (which was on Sun workstations).

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

<ubgoee$2rs7p$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27730&group=comp.lang.c#27730

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Tue, 15 Aug 2023 20:50:22 -0000 (UTC)
Organization: The Pitcher Digital Freehold
Lines: 52
Message-ID: <ubgoee$2rs7p$1@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<ubg25m$2rr3g$1@dont-email.me> <ubg4no$8kb$1@milena.home.net.it>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<87sf8k2gw3.fsf@fatphil.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 15 Aug 2023 20:50:22 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b9fe62aaa481b198f39e9a3eccd39311";
logging-data="3010809"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19na7UcZTXu/ubl2Y6oO4wqrWBJVk/yiWA="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:LXokw1Vg91DsV/oE21Nlm7aHbV4=
 by: Lew Pitcher - Tue, 15 Aug 2023 20:50 UTC

On Tue, 15 Aug 2023 23:24:28 +0300, Phil Carmody wrote:

> kalevi@kolttonen.fi (Kalevi Kolttonen) writes:
>> Kenny McCormack <gazelle@shell.xmission.com> wrote:
>>> But do they know that???
>>
>> "They" probably don't know it. But let's face it,
>> nobody really wants to create a file having '-'
>> filename on purpose. The filename is not descriptive
>> at all, it would be just an insane choice for anything
>> useful.
>>
>> It could happen by accident, but even that is quite
>> unlikely.
>>
>> If "they" don't know how to delete it, there is no need
>> to panic. The file's existence does no harm. "They" can
>> always ask for help and someone will tell them how
>> to get rid of it.
>>
>> I guess the stdin convention '-' is decades old.
>> It was chosen because they had pick something that
>> is short and not likely to exist as a real file.
>
> I propose that '|' might have been better - it's even mnemonic.

But, '|' conflicts with the shell pipe character, and would need
a workaround in some cases. For example,

foo bar | blech

could either pipe stdout from foo (which processed bar) into
blech, or it could instruct foo to accept bar, stdin and blech
as inputs. And, unless you escape or singlequote the pipe character,
the pipe-command interpretation wins.

Similarly,

foo bar - blech

could either ask foo to read files "bar", "-" and "blech"
/or/ ask foo to read files "bar", stdin, and "blech",
depending on the presence (or absence) of a file named "-"
Again, the accepted method of discerning one from the other
is to modify that "-" to "./-", indicating a file (in the
current working directory) named "-".

So, pOHtato, pAHtato.

--
Lew Pitcher
"In Skills We Trust"

Re: Piping to stdin

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

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27743&group=comp.lang.c#27743

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
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.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Wed, 16 Aug 2023 03:20:25 +0100
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <87msyrhgnq.fsf@bsb.me.uk>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<ubg25m$2rr3g$1@dont-email.me> <ubg4no$8kb$1@milena.home.net.it>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="f23095e1eb81acb3fb188baae9243a4f";
logging-data="3328695"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Ts/QYhZx43iA5K6e+EubPYBGf2OMHxC4="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:bD86P5VUi5kMm6VhrDb72TJDwvc=
sha1:yBhoZnwNsO+Q4Vn0+bIzE2xXD3c=
X-BSB-Auth: 1.ed56b3b3c6ea13cbbc5f.20230816032025BST.87msyrhgnq.fsf@bsb.me.uk
 by: Ben Bacarisse - Wed, 16 Aug 2023 02:20 UTC

kalevi@kolttonen.fi (Kalevi Kolttonen) writes:

> I guess the stdin convention '-' is decades old.
> It was chosen because they had pick something that
> is short and not likely to exist as a real file.

If I were doing this all from scratch, I'd consider choosing /- as the
convention. It's never a "user" file, and anyone capable of creating it
should know how to remove it.

--
Ben.

Re: Piping to stdin

<ubhnad$36om0$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27744&group=comp.lang.c#27744

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Wed, 16 Aug 2023 01:37:17 -0400
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <ubhnad$36om0$1@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<LtQSo3SOOU09AXJ1X@bongo-ra.co> <ubbua5$3hium$1@news.xmission.com>
<20230813200644.979@kylheku.com> <ubc63c$3hlul$2@news.xmission.com>
<ubdgcv$2carp$2@dont-email.me> <vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<20230814215312.550@kylheku.com> <wwvleeceobt.fsf@LkoBDZeT.terraraq.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 16 Aug 2023 05:37:17 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="564de306bc790f1858bdb09f489e6181";
logging-data="3367616"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+soEDdss4WEnnpebCkNHy3CbpUE4c/wpc="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:ANFITiwTgYdim+DZT4cSclGPNGw=
Content-Language: en-US
In-Reply-To: <wwvleeceobt.fsf@LkoBDZeT.terraraq.uk>
 by: James Kuyper - Wed, 16 Aug 2023 05:37 UTC

On 8/15/23 03:50, Richard Kettlewell wrote:
> Kaz Kylheku <864-117-4973@kylheku.com> writes:
....
>> The interesction of:
>>
>> - Users who make filenames like "-foo" and "monthly forecast.xls"
>>
>> - Users who sit in a POSIX shell expanding wildcards like *
>> in the same directory.
>>
>> is probababy vanishingly nil, and the subset of those who do the
>> above in the same directory is even smaller.
>
> The cases I’ve encountered are where someone accidentally creates a file
> with a weird name (starts with - or whatever) and then has trouble
> deleting it. I don’t think they got as far as having accidents with
> wildcards in the cases I remember, but the basic setup of a file with a
> ridiculous name and a non-expert user does happen occasionally.

The most bizarre filenames I've seen were generally created by one of
two mechanisms: Copy-and-pasting a command line into a terminal window,
where a minor slip of the mouse resulted in the copy including far more
material than it was supposed to. Most of the resulting lines of text do
nothing, but every once in a while a line starts with a word that is a
valid unix command name, and some very weird things happen.

The second scenario is where someone stupidly gave an ordinary text file
execute permission, and someone else accidentally typed the name of that
file in a context where it would invoke the supposed "executable". The
results were similar to those from the copy-and-past problem, except
that some of the text files were much longer, increasing the chance of a
line from the file actually resulting in non-trivial behavior.

Re: Piping to stdin

<ubhqlo$374bv$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27745&group=comp.lang.c#27745

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: val...@cultnix.org (vallor)
Newsgroups: comp.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Wed, 16 Aug 2023 06:34:32 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <ubhqlo$374bv$1@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<LtQSo3SOOU09AXJ1X@bongo-ra.co> <ubbua5$3hium$1@news.xmission.com>
<20230813200644.979@kylheku.com> <ubc63c$3hlul$2@news.xmission.com>
<ubdgcv$2carp$2@dont-email.me>
<vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<20230814215312.550@kylheku.com> <wwvleeceobt.fsf@LkoBDZeT.terraraq.uk>
<ubfus8$2rc7s$1@dont-email.me> <ubghe4$2ubhu$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 16 Aug 2023 06:34:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2b5b233b25b27017da6cb2fb007dbeff";
logging-data="3379583"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Qgu6+w9cxDg1DCsP0hOjr"
User-Agent: Pan/0.154 (Izium; b9ffd3c gitlab.gnome.org/GNOME/pan.git)
Cancel-Lock: sha1:Vc5Hv8q9m6TUz/+o+CTlThRaT+4=
X-Face: \}2`P"_@pS86<'EM:'b.Ml}8IuMK"pV"?FReF$'c.S%u9<Q#U*4QO)$l81M`{Q/n
XL'`91kd%N::LG:=*\35JS0prp\VJN^<s"b#bff@fA7]5lJA.jn,x_d%Md$,{.EZ
 by: vallor - Wed, 16 Aug 2023 06:34 UTC

On Tue, 15 Aug 2023 19:50:44 +0100, Richard Harnden
<richard.nospam@gmail.com> wrote in <ubghe4$2ubhu$1@dont-email.me>:

> On 15/08/2023 14:34, David Brown wrote:
>> On 15/08/2023 09:50, Richard Kettlewell wrote:
>>> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>>>> On 2023-08-15, Gary R. Schmidt <grschmidt@acm.org> wrote:
>>>>> Ahah!  You don't have users, do you?
>>>>>
>>>>> No doubt you also don't encounter filenames with spaces in them, or
>>>>> carriage returns, or other garbage.
>>>>
>>>> The interesction of:
>>>>
>>>> - Users who make filenames like "-foo" and "monthly forecast.xls"
>>>>
>>>> - Users who sit in a POSIX shell expanding wildcards like *
>>>>    in the same directory.
>>>>
>>>> is probababy vanishingly nil, and the subset of those who do the
>>>> above in the same directory is even smaller.
>>>
>>> The cases I’ve encountered are where someone accidentally creates a
>>> file with a weird name (starts with - or whatever) and then has
>>> trouble deleting it. I don’t think they got as far as having accidents
>>> with wildcards in the cases I remember, but the basic setup of a file
>>> with a ridiculous name and a non-expert user does happen occasionally.
>>>
>>>
>> It's usually sufficient just to put the awkward name inside quotation
>> marks.
>>
>>
>>
> But people won't/don't do that.
>
> Also:
>
> $ >-f $ >-r $ rm *
>
> How to safely cater for all 'weird' inputs?

(wondering if this belongs in comp.unix.shell, but here goes:)

In the 90's and maybe the early 2000's, many of our
(large installation) servers had a '-i' file in their
root directories. I'm not sure how widespread the
practice was, but I don't think we invented it.

--
-v

Re: Piping to stdin

<ubi1ij$37upp$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27749&group=comp.lang.c#27749

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: richard....@gmail.com (Richard Harnden)
Newsgroups: comp.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Wed, 16 Aug 2023 09:32:19 +0100
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <ubi1ij$37upp$1@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<LtQSo3SOOU09AXJ1X@bongo-ra.co> <ubbua5$3hium$1@news.xmission.com>
<20230813200644.979@kylheku.com> <ubc63c$3hlul$2@news.xmission.com>
<ubdgcv$2carp$2@dont-email.me> <vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<20230814215312.550@kylheku.com> <1by1ic2n67.fsf@pfeifferfamily.net>
Reply-To: nospam.harnden@gmail.com
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 16 Aug 2023 08:32:19 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ee8088279b252440a53acedb0073dea9";
logging-data="3406649"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/vp7akEKSqbHp9EnyxSlTt4QxKRF8oKUM="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.14.0
Cancel-Lock: sha1:4Asc22F/fsvedSXZSiWLX52ZMt8=
In-Reply-To: <1by1ic2n67.fsf@pfeifferfamily.net>
 by: Richard Harnden - Wed, 16 Aug 2023 08:32 UTC

On 15/08/2023 19:08, Joe Pfeiffer wrote:
> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>
>> On 2023-08-15, Gary R. Schmidt <grschmidt@acm.org> wrote:
>>> On 15/08/2023 01:14, Kalevi Kolttonen wrote:
>>>> In comp.unix.programmer Kenny McCormack <gazelle@shell.xmission.com> wrote:
>>>>> You know that - and I know that - but do they know that?
>>>>
>>>> It makes no difference. In the real world nobody has
>>>> files named '-'.
>>>>
>>>> br,
>>>> KK
>>>
>>> Ahah! You don't have users, do you?
>>>
>>> No doubt you also don't encounter filenames with spaces in them, or
>>> carriage returns, or other garbage.
>>
>> The interesction of:
>>
>> - Users who make filenames like "-foo" and "monthly forecast.xls"
>>
>> - Users who sit in a POSIX shell expanding wildcards like *
>> in the same directory.
>>
>> is probababy vanishingly nil, and the subset of those who do the
>> above in the same directory is even smaller.
>>
>> Now admin scripts do have to handle the files created by the goofy users
>> in the first category.
>>
>> Admin scripts don't ahve to worry about users creating a file
>> called -, because admin scripts won't be run in the directory
>> where the user did that. Not even scripts which do process
>> paths traversing that directory. The admin (or cron, or systemd or
>> whatever) will run those from somewhere else.
>
> Though I expect just about everyone has tried to run foo -xyz and
> inadvertently run foo - xyz instead, ending up with a file named - and
> one named xyz.

$ rm -rf * .tmp
rm: .tmp: No such file or directory
$ unrm
-ksh: unrm: not found
$ man cpio

Re: Piping to stdin

<ubib2o$394g8$5@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27760&group=comp.lang.c#27760

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Wed, 16 Aug 2023 13:14:32 +0200
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <ubib2o$394g8$5@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<LtQSo3SOOU09AXJ1X@bongo-ra.co> <ubbua5$3hium$1@news.xmission.com>
<20230813200644.979@kylheku.com> <ubc63c$3hlul$2@news.xmission.com>
<ubdgcv$2carp$2@dont-email.me> <vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<20230814215312.550@kylheku.com> <wwvleeceobt.fsf@LkoBDZeT.terraraq.uk>
<ubhnad$36om0$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 16 Aug 2023 11:14:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="31f88dcb6b6bb39d1a90cf8e0c2a62fe";
logging-data="3445256"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX183HOxZz05YkWwSvNikYcdTlRUBV/jr0BQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:dtU6GoDoePNCejQbgdpaRJ3R24c=
Content-Language: en-GB
In-Reply-To: <ubhnad$36om0$1@dont-email.me>
 by: David Brown - Wed, 16 Aug 2023 11:14 UTC

On 16/08/2023 07:37, James Kuyper wrote:
> On 8/15/23 03:50, Richard Kettlewell wrote:
>> Kaz Kylheku <864-117-4973@kylheku.com> writes:
> ...
>>> The interesction of:
>>>
>>> - Users who make filenames like "-foo" and "monthly forecast.xls"
>>>
>>> - Users who sit in a POSIX shell expanding wildcards like *
>>> in the same directory.
>>>
>>> is probababy vanishingly nil, and the subset of those who do the
>>> above in the same directory is even smaller.
>>
>> The cases I’ve encountered are where someone accidentally creates a file
>> with a weird name (starts with - or whatever) and then has trouble
>> deleting it. I don’t think they got as far as having accidents with
>> wildcards in the cases I remember, but the basic setup of a file with a
>> ridiculous name and a non-expert user does happen occasionally.
>
> The most bizarre filenames I've seen were generally created by one of
> two mechanisms: Copy-and-pasting a command line into a terminal window,
> where a minor slip of the mouse resulted in the copy including far more
> material than it was supposed to. Most of the resulting lines of text do
> nothing, but every once in a while a line starts with a word that is a
> valid unix command name, and some very weird things happen.
>
> The second scenario is where someone stupidly gave an ordinary text file
> execute permission, and someone else accidentally typed the name of that
> file in a context where it would invoke the supposed "executable". The
> results were similar to those from the copy-and-past problem, except
> that some of the text files were much longer, increasing the chance of a
> line from the file actually resulting in non-trivial behavior.

I have seen some odd names on file servers, when people have tried to
make certain files sort at the top or bottom of a list by prefixing with
odd characters (such as a space - that's always fun).

Many punctuation marks that are easy to use in gui programs are awkward
on the command line - brackets, quotation marks, ampersand, etc. Mostly
you can handle them on the command line by using quotation marks, or
backslash escapes.

Re: Piping to stdin

<87fs4j2i27.fsf@fatphil.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27771&group=comp.lang.c#27771

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
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.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Wed, 16 Aug 2023 17:11:28 +0300
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <87fs4j2i27.fsf@fatphil.org>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<ubg25m$2rr3g$1@dont-email.me> <ubg4no$8kb$1@milena.home.net.it>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<87sf8k2gw3.fsf@fatphil.org> <ubgoee$2rs7p$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="1b3a9e5cff33772e3b5b11700c1cdfef";
logging-data="3498711"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18n9qrG1h+8+KiIUA+scaij"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:CkcyTRmPpVJHNvo4kFs8CXLJZkc=
sha1:GoXShi1zl04yVIT2hA6BMTTMRKA=
 by: Phil Carmody - Wed, 16 Aug 2023 14:11 UTC

Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes:
> On Tue, 15 Aug 2023 23:24:28 +0300, Phil Carmody wrote:
>> kalevi@kolttonen.fi (Kalevi Kolttonen) writes:
>>> Kenny McCormack <gazelle@shell.xmission.com> wrote:
>>>> But do they know that???
>>>
>>> "They" probably don't know it. But let's face it,
>>> nobody really wants to create a file having '-'
>>> filename on purpose. The filename is not descriptive
>>> at all, it would be just an insane choice for anything
>>> useful.
>>>
>>> It could happen by accident, but even that is quite
>>> unlikely.
>>>
>>> If "they" don't know how to delete it, there is no need
>>> to panic. The file's existence does no harm. "They" can
>>> always ask for help and someone will tell them how
>>> to get rid of it.
>>>
>>> I guess the stdin convention '-' is decades old.
>>> It was chosen because they had pick something that
>>> is short and not likely to exist as a real file.
>>
>> I propose that '|' might have been better - it's even mnemonic.
>
> But, '|' conflicts with the shell pipe character, and would need
> a workaround in some cases. For example,

It's doing something special, why wouldn't you expect to do something
special to make use of it?

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

<878rab2hbb.fsf@fatphil.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27775&group=comp.lang.c#27775

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
Path: i2pn2.org!rocksolid2!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: pc+use...@asdf.org (Phil Carmody)
Newsgroups: comp.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Wed, 16 Aug 2023 17:27:36 +0300
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <878rab2hbb.fsf@fatphil.org>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<LtQSo3SOOU09AXJ1X@bongo-ra.co> <ubbua5$3hium$1@news.xmission.com>
<20230813200644.979@kylheku.com> <ubc63c$3hlul$2@news.xmission.com>
<ubdgcv$2carp$2@dont-email.me>
<vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<20230814215312.550@kylheku.com> <1by1ic2n67.fsf@pfeifferfamily.net>
<ubi1ij$37upp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="1b3a9e5cff33772e3b5b11700c1cdfef";
logging-data="3510469"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19IND7PYppG2xCAqUSnGnvW"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:ocH+OWEACHYuZfIK8Fud8yKFeDQ=
sha1:Rm6P6NXNkkIvNRQ0ARK5PpZECWE=
 by: Phil Carmody - Wed, 16 Aug 2023 14:27 UTC

Richard Harnden <richard.nospam@gmail.com> writes:
> On 15/08/2023 19:08, Joe Pfeiffer wrote:
>> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>>> On 2023-08-15, Gary R. Schmidt <grschmidt@acm.org> wrote:
>>>> On 15/08/2023 01:14, Kalevi Kolttonen wrote:
>>>>> In comp.unix.programmer Kenny McCormack <gazelle@shell.xmission.com> wrote:
>>>>>> You know that - and I know that - but do they know that?
>>>>>
>>>>> It makes no difference. In the real world nobody has
>>>>> files named '-'.
>>>>>
>>>>> br,
>>>>> KK
>>>>
>>>> Ahah! You don't have users, do you?
>>>>
>>>> No doubt you also don't encounter filenames with spaces in them, or
>>>> carriage returns, or other garbage.
>>>
>>> The interesction of:
>>>
>>> - Users who make filenames like "-foo" and "monthly forecast.xls"
>>>
>>> - Users who sit in a POSIX shell expanding wildcards like *
>>> in the same directory.
>>>
>>> is probababy vanishingly nil, and the subset of those who do the
>>> above in the same directory is even smaller.
>>>
>>> Now admin scripts do have to handle the files created by the goofy users
>>> in the first category.
>>>
>>> Admin scripts don't ahve to worry about users creating a file
>>> called -, because admin scripts won't be run in the directory
>>> where the user did that. Not even scripts which do process
>>> paths traversing that directory. The admin (or cron, or systemd or
>>> whatever) will run those from somewhere else.
>>
>> Though I expect just about everyone has tried to run foo -xyz and
>> inadvertently run foo - xyz instead, ending up with a file named - and
>> one named xyz.
>
> $ rm -rf * .tmp
> rm: .tmp: No such file or directory
> $ unrm
> -ksh: unrm: not found
> $ man cpio

Spurious spaces are less common than this mistake, which I have seen
done by someone (who was at elevated privs at the time):

# rm *>o

(For those in exotic-keyboard-land: '>' was shifted '.', thus the
shift required for '*' hadn't been released yet.)

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

<ubipom$3ajkp$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27777&group=comp.lang.c#27777

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Wed, 16 Aug 2023 15:25:10 -0000 (UTC)
Organization: The Pitcher Digital Freehold
Lines: 26
Message-ID: <ubipom$3ajkp$1@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<ubg25m$2rr3g$1@dont-email.me> <ubg4no$8kb$1@milena.home.net.it>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<87sf8k2gw3.fsf@fatphil.org> <ubgoee$2rs7p$1@dont-email.me>
<87fs4j2i27.fsf@fatphil.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 16 Aug 2023 15:25:10 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b581253026a9998bab917224ced56283";
logging-data="3493529"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+GyatAJKwzk2bJkxpd61cE4NGM0Nsx6h4="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:ToMVshA2I+nKsIeIu9QvQrSbxWk=
 by: Lew Pitcher - Wed, 16 Aug 2023 15:25 UTC

On Wed, 16 Aug 2023 17:11:28 +0300, Phil Carmody wrote:

> Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes:
>> On Tue, 15 Aug 2023 23:24:28 +0300, Phil Carmody wrote:
[snip]
>>>> I guess the stdin convention '-' is decades old.
>>>> It was chosen because they had pick something that
>>>> is short and not likely to exist as a real file.
>>>
>>> I propose that '|' might have been better - it's even mnemonic.
>>
>> But, '|' conflicts with the shell pipe character, and would need
>> a workaround in some cases. For example,
>
> It's doing something special, why wouldn't you expect to do something
> special to make use of it?

Okay, then. How about a counter proposal:
For Unix shells, the < character indicates redirection of stdin.
I propose that '<' might have been a better choice as a standard
program option to flag "read from stdin" than either '|' /or/ '-'
were. :-)

--
Lew Pitcher
"In Skills We Trust"

Re: Piping to stdin

<wwvr0o3j618.fsf@LkoBDZeT.terraraq.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27781&group=comp.lang.c#27781

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
Path: i2pn2.org!i2pn.org!news.niel.me!news.gegeweb.eu!gegeweb.org!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail
From: inva...@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Wed, 16 Aug 2023 17:39:15 +0100
Organization: terraraq NNTP server
Message-ID: <wwvr0o3j618.fsf@LkoBDZeT.terraraq.uk>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<LtQSo3SOOU09AXJ1X@bongo-ra.co> <ubbua5$3hium$1@news.xmission.com>
<20230813200644.979@kylheku.com> <ubc63c$3hlul$2@news.xmission.com>
<ubdgcv$2carp$2@dont-email.me>
<vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<20230814215312.550@kylheku.com>
<wwvleeceobt.fsf@LkoBDZeT.terraraq.uk> <ubfus8$2rc7s$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6";
logging-data="58507"; mail-complaints-to="usenet@innmantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:E/pR2cX1rfd71eLlC5AJaLyA9tA=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
 by: Richard Kettlewell - Wed, 16 Aug 2023 16:39 UTC

David Brown <david.brown@hesbynett.no> writes:
> On 15/08/2023 09:50, Richard Kettlewell wrote:
>> The cases I’ve encountered are where someone accidentally creates a
>> file with a weird name (starts with - or whatever) and then has
>> trouble deleting it. I don’t think they got as far as having
>> accidents with wildcards in the cases I remember, but the basic setup
>> of a file with a ridiculous name and a non-expert user does happen
>> occasionally.
>
> It's usually sufficient just to put the awkward name inside quotation marks.

In the case we started with, quoting is not sufficient.

--
https://www.greenend.org.uk/rjk/

Re: Piping to stdin

<TP7DM.428701$U3w1.87269@fx09.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27791&group=comp.lang.c#27791

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx09.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Piping to stdin
Newsgroups: comp.unix.programmer,comp.lang.c
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com> <LtQSo3SOOU09AXJ1X@bongo-ra.co> <ubbua5$3hium$1@news.xmission.com> <20230813200644.979@kylheku.com> <ubc63c$3hlul$2@news.xmission.com> <ubdgcv$2carp$2@dont-email.me> <vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au> <20230814215312.550@kylheku.com> <wwvleeceobt.fsf@LkoBDZeT.terraraq.uk> <ubfus8$2rc7s$1@dont-email.me> <wwvr0o3j618.fsf@LkoBDZeT.terraraq.uk>
Lines: 17
Message-ID: <TP7DM.428701$U3w1.87269@fx09.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Wed, 16 Aug 2023 17:37:55 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Wed, 16 Aug 2023 17:37:55 GMT
X-Received-Bytes: 1765
 by: Scott Lurndal - Wed, 16 Aug 2023 17:37 UTC

Richard Kettlewell <invalid@invalid.invalid> writes:
>David Brown <david.brown@hesbynett.no> writes:
>> On 15/08/2023 09:50, Richard Kettlewell wrote:
>>> The cases I’ve encountered are where someone accidentally creates a
>>> file with a weird name (starts with - or whatever) and then has
>>> trouble deleting it. I don’t think they got as far as having
>>> accidents with wildcards in the cases I remember, but the basic setup
>>> of a file with a ridiculous name and a non-expert user does happen
>>> occasionally.
>>
>> It's usually sufficient just to put the awkward name inside quotation marks.
>
>In the case we started with, quoting is not sufficient.

Doesn't that depend on the type of quote? glob characters (*, ?) are
treated as regular characters in single quotes, for example.

Re: Piping to stdin

<ubj1rr$3l8k0$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27792&group=comp.lang.c#27792

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!1.us.feeder.erje.net!2.us.feeder.erje.net!feeder.erje.net!news.snarked.org!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Wed, 16 Aug 2023 17:43:23 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <ubj1rr$3l8k0$1@news.xmission.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com> <ubfus8$2rc7s$1@dont-email.me> <wwvr0o3j618.fsf@LkoBDZeT.terraraq.uk> <TP7DM.428701$U3w1.87269@fx09.iad>
Injection-Date: Wed, 16 Aug 2023 17:43:23 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="3842688"; 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 - Wed, 16 Aug 2023 17:43 UTC

In article <TP7DM.428701$U3w1.87269@fx09.iad>,
Scott Lurndal <slp53@pacbell.net> wrote:
>Richard Kettlewell <invalid@invalid.invalid> writes:
>>David Brown <david.brown@hesbynett.no> writes:
>>> On 15/08/2023 09:50, Richard Kettlewell wrote:
>>>> The cases Ive encountered are where someone accidentally creates a
>>>> file with a weird name (starts with - or whatever) and then has
>>>> trouble deleting it. I dont think they got as far as having
>>>> accidents with wildcards in the cases I remember, but the basic setup
>>>> of a file with a ridiculous name and a non-expert user does happen
>>>> occasionally.
>>>
>>> It's usually sufficient just to put the awkward name inside
>>> quotation marks.
>>
>>In the case we started with, quoting is not sufficient.
>
>Doesn't that depend on the type of quote? glob characters (*, ?) are
>treated as regular characters in single quotes, for example.

You're missing the point.

--
Treating the stock market indexes as general measures of the well-being of a
society is like treating your blood pressure as an indicator of health. The
higher, the better, right? In fact, a high stock market is good for the investor
class, but it means the rest of us are getting screwed better than ever.

Re: Piping to stdin

<20230816121355.702@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27797&group=comp.lang.c#27797

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
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.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Wed, 16 Aug 2023 19:29:11 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 53
Message-ID: <20230816121355.702@kylheku.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<ubg25m$2rr3g$1@dont-email.me> <ubg4no$8kb$1@milena.home.net.it>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<87sf8k2gw3.fsf@fatphil.org> <ubgoee$2rs7p$1@dont-email.me>
<87fs4j2i27.fsf@fatphil.org> <ubipom$3ajkp$1@dont-email.me>
Injection-Date: Wed, 16 Aug 2023 19:29:11 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d89b22cba778372e2da36441b02fe0e1";
logging-data="3599158"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Ng1zLMT6A43PSOp7azoVPo2MuEBy8wQ0="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:D4vmRTAOZF/pWJjNOVavyFGIzSE=
 by: Kaz Kylheku - Wed, 16 Aug 2023 19:29 UTC

On 2023-08-16, Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
> On Wed, 16 Aug 2023 17:11:28 +0300, Phil Carmody wrote:
>
>> Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes:
>>> On Tue, 15 Aug 2023 23:24:28 +0300, Phil Carmody wrote:
> [snip]
>>>>> I guess the stdin convention '-' is decades old.
>>>>> It was chosen because they had pick something that
>>>>> is short and not likely to exist as a real file.
>>>>
>>>> I propose that '|' might have been better - it's even mnemonic.
>>>
>>> But, '|' conflicts with the shell pipe character, and would need
>>> a workaround in some cases. For example,
>>
>> It's doing something special, why wouldn't you expect to do something
>> special to make use of it?
>
> Okay, then. How about a counter proposal:
> For Unix shells, the < character indicates redirection of stdin.
> I propose that '<' might have been a better choice as a standard
> program option to flag "read from stdin" than either '|' /or/ '-'
> were. :-)

Counter-counter proposal #1:

The issue is that "commmand *" can generate the - name
or arguments that look like options.

But * skips things that begin with dot!

So, use that for options:

rm .rf *

Counter-couner proposal #2:

Problem is that we often operate on dot files.

Solution: have it so that * skips names that start with
dash; so if someone wants * to match - or -rf, they
must use "command -*".

Bash could have a "shopt -s dashglob" to make *
match dashed items.

I think it might be worth implementing dashglob Bash,
enabled by default.

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

Re: Piping to stdin

<877cpulo80.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27803&group=comp.lang.c#27803

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
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.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Wed, 16 Aug 2023 13:35:43 -0700
Organization: None to speak of
Lines: 36
Message-ID: <877cpulo80.fsf@nosuchdomain.example.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<LtQSo3SOOU09AXJ1X@bongo-ra.co> <ubbua5$3hium$1@news.xmission.com>
<20230813200644.979@kylheku.com> <ubc63c$3hlul$2@news.xmission.com>
<ubdgcv$2carp$2@dont-email.me>
<vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<20230814215312.550@kylheku.com>
<wwvleeceobt.fsf@LkoBDZeT.terraraq.uk> <ubfus8$2rc7s$1@dont-email.me>
<wwvr0o3j618.fsf@LkoBDZeT.terraraq.uk>
<TP7DM.428701$U3w1.87269@fx09.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="15135efa85b793336b66170ecb85b528";
logging-data="3599848"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+J2cp/B42qxgVtBAZNBOVl"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:Kw/zCe4z2CUezQfFOiRFYK/buAM=
sha1:3c5qkgqSycUeovZC/nCcizix5IY=
 by: Keith Thompson - Wed, 16 Aug 2023 20:35 UTC

scott@slp53.sl.home (Scott Lurndal) writes:
> Richard Kettlewell <invalid@invalid.invalid> writes:
>>David Brown <david.brown@hesbynett.no> writes:
>>> On 15/08/2023 09:50, Richard Kettlewell wrote:
>>>> The cases I’ve encountered are where someone accidentally creates a
>>>> file with a weird name (starts with - or whatever) and then has
>>>> trouble deleting it. I don’t think they got as far as having
>>>> accidents with wildcards in the cases I remember, but the basic setup
>>>> of a file with a ridiculous name and a non-expert user does happen
>>>> occasionally.
>>>
>>> It's usually sufficient just to put the awkward name inside quotation marks.
>>
>>In the case we started with, quoting is not sufficient.
>
> Doesn't that depend on the type of quote? glob characters (*, ?) are
> treated as regular characters in single quotes, for example.

Not in this case -- and glob characters are not expanded in either
single or doublle quotes.

The difference is that * and ? are expanded by the shell, so the
invoked command never sees them, but arguments starting with -
are treated specially by the command itself.

If you have a file named *, you can delete it with `rm '*'` or
`rm "*"`, or `rm \*`.

If you have a file named -r, you can delete it with `rm ./-r`, or
`rm -- -r` if your rm implementation supports that (POSIX doesn't
specify it).

--
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

<ubksl2$3o8ao$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27835&group=comp.lang.c#27835

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Mutt...@dastardlyhq.com
Newsgroups: comp.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Thu, 17 Aug 2023 10:26:42 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <ubksl2$3o8ao$1@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com> <vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au> <ubg25m$2rr3g$1@dont-email.me> <ubg4no$8kb$1@milena.home.net.it> <ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me> <ubg8a8$2t20l$1@dont-email.me> <ubg8no$2t2as$1@dont-email.me>
Injection-Date: Thu, 17 Aug 2023 10:26:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c22366ece291fcc511ce050dc38e085e";
logging-data="3940696"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Xj9ycP8TDqWkC1RWL9V+P"
Cancel-Lock: sha1:E1WlrSmvDidCzSI/j8o0D1jjdAU=
 by: Mutt...@dastardlyhq.com - Thu, 17 Aug 2023 10:26 UTC

On Tue, 15 Aug 2023 16:22:16 -0000 (UTC)
kalevi@kolttonen.fi (Kalevi Kolttonen) wrote:
>In comp.unix.programmer Muttley@dastardlyhq.com wrote:
>> On Tue, 15 Aug 2023 16:12:19 -0000 (UTC)
>> kalevi@kolttonen.fi (Kalevi Kolttonen) wrote:
>>>Kenny McCormack <gazelle@shell.xmission.com> wrote:
>>>> But do they know that???
>>>
>>>"They" probably don't know it. But let's face it,
>>>nobody really wants to create a file having '-'
>>>filename on purpose. The filename is not descriptive
>>>at all, it would be just an insane choice for anything
>>>useful.
>>
>> I used to think the same thing about spaces in filenames. Then along came
>> Windows.
>
>Filenames having spaces versus the stdin convention '-' is
>comparing two things that are very different.
>
>The first one is just a way to name files or directories.
>
>The second one is an age-old Unix convention that has
>nothing to do with naming real files or directories.
>
>It is best to not to confuse these two distinct ideas.

They both cause problems.

Re: Piping to stdin

<ubkt02$3o9rp$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27836&group=comp.lang.c#27836

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Mutt...@dastardlyhq.com
Newsgroups: comp.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Thu, 17 Aug 2023 10:32:34 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <ubkt02$3o9rp$1@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<ubg25m$2rr3g$1@dont-email.me> <ubg4no$8kb$1@milena.home.net.it>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me>
<87o7j82gix.fsf@fatphil.org>
Injection-Date: Thu, 17 Aug 2023 10:32:34 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c22366ece291fcc511ce050dc38e085e";
logging-data="3942265"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Tmf+o7OwMTIFsEQNKwdTv"
Cancel-Lock: sha1:tqV2x/habL3csZe3MD+ffdcs7jc=
 by: Mutt...@dastardlyhq.com - Thu, 17 Aug 2023 10:32 UTC

On Tue, 15 Aug 2023 23:32:22 +0300
Phil Carmody <pc+usenet@asdf.org> wrote:
>Muttley@dastardlyhq.com writes:
>> On Tue, 15 Aug 2023 16:12:19 -0000 (UTC)
>> kalevi@kolttonen.fi (Kalevi Kolttonen) wrote:
>>>Kenny McCormack <gazelle@shell.xmission.com> wrote:
>>>> But do they know that???
>>>
>>>"They" probably don't know it. But let's face it,
>>>nobody really wants to create a file having '-'
>>>filename on purpose. The filename is not descriptive
>>>at all, it would be just an insane choice for anything
>>>useful.
>>
>> I used to think the same thing about spaces in filenames. Then along came
>> Windows.
>
>Your memory if flawed. Spaces were always allowed in unix
>filenames. Often used to hide things in plain sight on FTP sites, for
>example.

Any character from 0-255 is allowed in unix filenames but only an idiot would
use spaces and non printing characters.

>MS Windows didn't allow spaces until Windows 95. I remember the Apple

DOS didn't like filenames more than 8 characters long and required a TLA.
So what?

It has become a standard in windows to use spaces in filenames no doubt due
to the hopeless command line interface so there was no necessity to play nice
with command line tools that by default use whitespace as field seperators.

>had it on my wall at work. Not because I was an Apple fanboi, far
>from it, but my disdain for all things MS Windows was already
>entrenched, and I was being forced to use it for the not-the-actual-work
>part of my job (which was on Sun workstations).

Apple arguably are even worse right now - case aware but case insensitive
unless you use wildcards on the command line when suddenly case matters again.
Hopeless.

eg:
fenris$ touch HELLO
fenris$ ls hello
hello
fenris$ ls H*
HELLO
fenris$ ls h*
ls: h*: No such file or directory

Re: Piping to stdin

<87350h28j9.fsf@fatphil.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27840&group=comp.lang.c#27840

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
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.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Thu, 17 Aug 2023 14:49:30 +0300
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <87350h28j9.fsf@fatphil.org>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<ubg25m$2rr3g$1@dont-email.me> <ubg4no$8kb$1@milena.home.net.it>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<87sf8k2gw3.fsf@fatphil.org> <ubgoee$2rs7p$1@dont-email.me>
<87fs4j2i27.fsf@fatphil.org> <ubipom$3ajkp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="c5ae6d758bdcdf7c941356aad3a595c3";
logging-data="3957524"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+UrKCx8J9LRguSWgcbft0"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:ltvNTJHekpY6BiijEQTpbT/9hOM=
sha1:nsDHvbtJmagTBUE4voEyzEIx3D8=
 by: Phil Carmody - Thu, 17 Aug 2023 11:49 UTC

Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes:
> On Wed, 16 Aug 2023 17:11:28 +0300, Phil Carmody wrote:
>> Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes:
>>> On Tue, 15 Aug 2023 23:24:28 +0300, Phil Carmody wrote:
> [snip]
>>>>> I guess the stdin convention '-' is decades old.
>>>>> It was chosen because they had pick something that
>>>>> is short and not likely to exist as a real file.
>>>>
>>>> I propose that '|' might have been better - it's even mnemonic.
>>>
>>> But, '|' conflicts with the shell pipe character, and would need
>>> a workaround in some cases. For example,
>>
>> It's doing something special, why wouldn't you expect to do something
>> special to make use of it?
>
> Okay, then. How about a counter proposal:
> For Unix shells, the < character indicates redirection of stdin.
> I propose that '<' might have been a better choice as a standard
> program option to flag "read from stdin" than either '|' /or/ '-'
> were. :-)

Why *better* than '|', rather than *equally good as*, given that the
logic is absolutely equivalent?

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

<87y1i9zy1s.fsf@fatphil.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27841&group=comp.lang.c#27841

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
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.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Thu, 17 Aug 2023 14:51:59 +0300
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <87y1i9zy1s.fsf@fatphil.org>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<LtQSo3SOOU09AXJ1X@bongo-ra.co> <ubbua5$3hium$1@news.xmission.com>
<20230813200644.979@kylheku.com> <ubc63c$3hlul$2@news.xmission.com>
<ubdgcv$2carp$2@dont-email.me>
<vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<20230814215312.550@kylheku.com>
<wwvleeceobt.fsf@LkoBDZeT.terraraq.uk> <ubfus8$2rc7s$1@dont-email.me>
<wwvr0o3j618.fsf@LkoBDZeT.terraraq.uk>
<TP7DM.428701$U3w1.87269@fx09.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="c5ae6d758bdcdf7c941356aad3a595c3";
logging-data="3957524"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19fPFItNWBZ48KU8bAZTgXo"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:WJxgM+HsIIqIMcSU1J75b390bBk=
sha1:i0xw15wy1QkaATQdGfh1GGPfkhc=
 by: Phil Carmody - Thu, 17 Aug 2023 11:51 UTC

scott@slp53.sl.home (Scott Lurndal) writes:
> Richard Kettlewell <invalid@invalid.invalid> writes:
>>David Brown <david.brown@hesbynett.no> writes:
>>> On 15/08/2023 09:50, Richard Kettlewell wrote:
>>>> The cases I’ve encountered are where someone accidentally creates a
>>>> file with a weird name (starts with - or whatever) and then has
>>>> trouble deleting it. I don’t think they got as far as having
>>>> accidents with wildcards in the cases I remember, but the basic setup
>>>> of a file with a ridiculous name and a non-expert user does happen
>>>> occasionally.
>>>
>>> It's usually sufficient just to put the awkward name inside quotation marks.
>>
>>In the case we started with, quoting is not sufficient.
>
> Doesn't that depend on the type of quote? glob characters (*, ?) are
> treated as regular characters in single quotes, for example.

No, it depends on the program you intend to pass the filename to, and
how it treats its arguments.

Which we don't know. So we can't say anything more at the moment.

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

<87ttsxzxs7.fsf@fatphil.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27842&group=comp.lang.c#27842

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
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.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Thu, 17 Aug 2023 14:57:44 +0300
Organization: A noiseless patient Spider
Lines: 64
Message-ID: <87ttsxzxs7.fsf@fatphil.org>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<ubg25m$2rr3g$1@dont-email.me> <ubg4no$8kb$1@milena.home.net.it>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <87o7j82gix.fsf@fatphil.org>
<ubkt02$3o9rp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="c5ae6d758bdcdf7c941356aad3a595c3";
logging-data="3957524"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/PH4ghsDLod1T/Cimfcbja"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:b99DfaSh1SKki0eCANbIimbzMEg=
sha1:nQeaQMv1NBY0KKokw+XFI9LtK0Y=
 by: Phil Carmody - Thu, 17 Aug 2023 11:57 UTC

Muttley@dastardlyhq.com writes:
> On Tue, 15 Aug 2023 23:32:22 +0300
> Phil Carmody <pc+usenet@asdf.org> wrote:
>>Muttley@dastardlyhq.com writes:
>>> On Tue, 15 Aug 2023 16:12:19 -0000 (UTC)
>>> kalevi@kolttonen.fi (Kalevi Kolttonen) wrote:
>>>>Kenny McCormack <gazelle@shell.xmission.com> wrote:
>>>>> But do they know that???
>>>>
>>>>"They" probably don't know it. But let's face it,
>>>>nobody really wants to create a file having '-'
>>>>filename on purpose. The filename is not descriptive
>>>>at all, it would be just an insane choice for anything
>>>>useful.
>>>
>>> I used to think the same thing about spaces in filenames. Then along came
>>> Windows.
>>
>>Your memory if flawed. Spaces were always allowed in unix
>>filenames. Often used to hide things in plain sight on FTP sites, for
>>example.
>
> Any character from 0-255 is allowed in unix filenames but only an idiot would
> use spaces and non printing characters.
>
>>MS Windows didn't allow spaces until Windows 95. I remember the Apple
>
> DOS didn't like filenames more than 8 characters long and required a TLA.
> So what?
>
> It has become a standard in windows to use spaces in filenames no doubt due
> to the hopeless command line interface so there was no necessity to play nice
> with command line tools that by default use whitespace as field seperators.
>
>>had it on my wall at work. Not because I was an Apple fanboi, far
>>from it, but my disdain for all things MS Windows was already
>>entrenched, and I was being forced to use it for the not-the-actual-work
>>part of my job (which was on Sun workstations).
>
> Apple arguably are even worse right now - case aware but case insensitive
> unless you use wildcards on the command line when suddenly case matters again.
> Hopeless.
>
> eg:
> fenris$ touch HELLO
> fenris$ ls hello
> hello
> fenris$ ls H*
> HELLO
> fenris$ ls h*
> ls: h*: No such file or directory

That I didn't know. Wow - if that's an actual interactive session being
quoted, that's frightening. Thanks for reminding me why my installation
of linux on my Apple G5 box wasn't moment too soon. How can people live
with such wrongthink? Stockholm Syndrome?

Mind geboggled,
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

<c0421064-01a0-44a1-8812-890bdc124b97n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27843&group=comp.lang.c#27843

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:1a9e:b0:40f:d4a1:48c9 with SMTP id s30-20020a05622a1a9e00b0040fd4a148c9mr50519qtc.4.1692274475518;
Thu, 17 Aug 2023 05:14:35 -0700 (PDT)
X-Received: by 2002:a17:903:32d1:b0:1bb:a13a:c21e with SMTP id
i17-20020a17090332d100b001bba13ac21emr2278241plr.10.1692274474673; Thu, 17
Aug 2023 05:14:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 17 Aug 2023 05:14:34 -0700 (PDT)
In-Reply-To: <87ttsxzxs7.fsf@fatphil.org>
Injection-Info: google-groups.googlegroups.com; posting-host=199.203.251.52; posting-account=ow8VOgoAAAAfiGNvoH__Y4ADRwQF1hZW
NNTP-Posting-Host: 199.203.251.52
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au> <ubg25m$2rr3g$1@dont-email.me>
<ubg4no$8kb$1@milena.home.net.it> <ubg6o7$3jrsn$1@news.xmission.com>
<ubg853$2ssj8$1@dont-email.me> <ubg8a8$2t20l$1@dont-email.me>
<87o7j82gix.fsf@fatphil.org> <ubkt02$3o9rp$1@dont-email.me> <87ttsxzxs7.fsf@fatphil.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c0421064-01a0-44a1-8812-890bdc124b97n@googlegroups.com>
Subject: Re: Piping to stdin
From: already5...@yahoo.com (Michael S)
Injection-Date: Thu, 17 Aug 2023 12:14:35 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Michael S - Thu, 17 Aug 2023 12:14 UTC

On Thursday, August 17, 2023 at 2:58:01 PM UTC+3, Phil Carmody wrote:
> Mut...@dastardlyhq.com writes:
> > On Tue, 15 Aug 2023 23:32:22 +0300
> > Phil Carmody <pc+u...@asdf.org> wrote:
> >>Mut...@dastardlyhq.com writes:
> >>> On Tue, 15 Aug 2023 16:12:19 -0000 (UTC)
> >>> kal...@kolttonen.fi (Kalevi Kolttonen) wrote:
> >>>>Kenny McCormack <gaz...@shell.xmission.com> wrote:
> >>>>> But do they know that???
> >>>>
> >>>>"They" probably don't know it. But let's face it,
> >>>>nobody really wants to create a file having '-'
> >>>>filename on purpose. The filename is not descriptive
> >>>>at all, it would be just an insane choice for anything
> >>>>useful.
> >>>
> >>> I used to think the same thing about spaces in filenames. Then along came
> >>> Windows.
> >>
> >>Your memory if flawed. Spaces were always allowed in unix
> >>filenames. Often used to hide things in plain sight on FTP sites, for
> >>example.
> >
> > Any character from 0-255 is allowed in unix filenames but only an idiot would
> > use spaces and non printing characters.
> >
> >>MS Windows didn't allow spaces until Windows 95. I remember the Apple
> >
> > DOS didn't like filenames more than 8 characters long and required a TLA.
> > So what?
> >
> > It has become a standard in windows to use spaces in filenames no doubt due
> > to the hopeless command line interface so there was no necessity to play nice
> > with command line tools that by default use whitespace as field seperators.
> >
> >>had it on my wall at work. Not because I was an Apple fanboi, far
> >>from it, but my disdain for all things MS Windows was already
> >>entrenched, and I was being forced to use it for the not-the-actual-work
> >>part of my job (which was on Sun workstations).
> >
> > Apple arguably are even worse right now - case aware but case insensitive
> > unless you use wildcards on the command line when suddenly case matters again.
> > Hopeless.
> >
> > eg:
> > fenris$ touch HELLO
> > fenris$ ls hello
> > hello
> > fenris$ ls H*
> > HELLO
> > fenris$ ls h*
> > ls: h*: No such file or directory
> That I didn't know. Wow - if that's an actual interactive session being
> quoted, that's frightening. Thanks for reminding me why my installation
> of linux on my Apple G5 box wasn't moment too soon. How can people live
> with such wrongthink? Stockholm Syndrome?
>
> Mind geboggled,
> 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/

Most computer users don't use command line. More so, I would think that most
computer users do not know that command line exists.
I'd guess that if shown command line many of them would say that it's people
like us that continue to insist on using command line are suffering from some
type of unhealthy mental syndrome.

Re: Piping to stdin

<20230817065027.422@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27847&group=comp.lang.c#27847

  copy link   Newsgroups: comp.unix.programmer comp.lang.c
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.unix.programmer,comp.lang.c
Subject: Re: Piping to stdin
Date: Thu, 17 Aug 2023 13:52:23 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <20230817065027.422@kylheku.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<vo5rqj-lpl.ln1@paranoia.mcleod-schmidt.id.au>
<ubg25m$2rr3g$1@dont-email.me> <ubg4no$8kb$1@milena.home.net.it>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <87o7j82gix.fsf@fatphil.org>
<ubkt02$3o9rp$1@dont-email.me>
Injection-Date: Thu, 17 Aug 2023 13:52:23 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1aa1e972d16a2b9e389dd8d4860af990";
logging-data="3992894"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/CzDzf3A8sTlmOZk8xN/A62rdcCHREydM="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:HQNulQbNwlr6VUbbIvSFoKb9hKI=
 by: Kaz Kylheku - Thu, 17 Aug 2023 13:52 UTC

On 2023-08-17, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote:
> Any character from 0-255 is allowed in unix filenames but only an idiot would
> use spaces and non printing characters.

That's simply false. 0 is the null terminator and is not actually part
of the name. The path-component-separating slash cannot be contained in
a path component; there is no escape mechanism to include it.

POSIX defines a set of characters which are recommended for use in file
names for portability; it is wise for applications and users to stick to
that.

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


devel / comp.lang.c / Re: Piping to stdin

Pages:12345
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor