Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

If you sow your wild oats, hope for a crop failure.


comp / comp.unix.programmer / Re: Long filenames in DOS/Windows and Unix/Linux

SubjectAuthor
* Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin)Kenny McCormack
+* Re: Long filenames in DOS/Windows and Unix/LinuxRichard Kettlewell
|+- Re: Long filenames in DOS/Windows and Unix/LinuxMuttley
|`* Re: Long filenames in DOS/Windows and Unix/LinuxLawrence D'Oliveiro
| +* Re: Long filenames in DOS/Windows and Unix/LinuxLawrence D'Oliveiro
| |+- Re: Long filenames in DOS/Windows and Unix/LinuxNuno Silva
| |+- Re: Long filenames in DOS/Windows and Unix/LinuxHelmut Waitzmann
| |+* Re: Long filenames in DOS/Windows and Unix/LinuxWayne
| ||`- Re: Long filenames in DOS/Windows and Unix/LinuxLawrence D'Oliveiro
| |`- Re: Long filenames in DOS/Windows and Unix/LinuxJanis Papanagnou
| `- Arbitrary characters in filenames (was: Long filenames in DOS/Windows and Unix/LHelmut Waitzmann
+* Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin)Muttley
|`* Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin)John Ames
| +* Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin)Scott Lurndal
| |`- Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin)Lew Pitcher
| +* Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin)Kenny McCormack
| |`* Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping toMuttley
| | `* User surveys (Was: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to)Kenny McCormack
| |  `- Re: User surveys (Was: Long filenames in DOS/Windows and Unix/Linux (Was: PipingMuttley
| +* Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin)Kaz Kylheku
| |`* Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin)John Ames
| | +* Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin)Kaz Kylheku
| | |`* Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin)John Ames
| | | +* Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin)Scott Lurndal
| | | |`- Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin)Lawrence D'Oliveiro
| | | `* Re: Long filenames in DOS/Windows and Unix/LinuxKeith Thompson
| | |  +* Re: Long filenames in DOS/Windows and Unix/LinuxLawrence D'Oliveiro
| | |  |+- Re: Long filenames in DOS/Windows and Unix/LinuxScott Lurndal
| | |  |`* Re: Long filenames in DOS/Windows and Unix/LinuxKeith Thompson
| | |  | +* Re: Long filenames in DOS/Windows and Unix/LinuxLawrence D'Oliveiro
| | |  | |+* Re: Long filenames in DOS/Windows and Unix/LinuxKeith Thompson
| | |  | ||`* Re: Long filenames in DOS/Windows and Unix/LinuxLawrence D'Oliveiro
| | |  | || `* Re: Long filenames in DOS/Windows and Unix/LinuxKeith Thompson
| | |  | ||  `- Re: Long filenames in DOS/Windows and Unix/LinuxLawrence D'Oliveiro
| | |  | |`* Re: Long filenames in DOS/Windows and Unix/LinuxRalf Fassel
| | |  | | `* Re: Long filenames in DOS/Windows and Unix/LinuxKeith Thompson
| | |  | |  `* Re: Long filenames in DOS/Windows and Unix/LinuxNuno Silva
| | |  | |   `* Always use "--" (Was: Long filenames in DOS/Windows and Unix/Linux)Kenny McCormack
| | |  | |    `* Re: Always use "--" (Was: Long filenames in DOS/Windows and Unix/Linux)Lew Pitcher
| | |  | |     +- Re: Always use "--" (Was: Long filenames in DOS/Windows and Unix/Linux)Lawrence D'Oliveiro
| | |  | |     `* Re: Always use "--" (Was: Long filenames in DOS/Windows and Unix/Linux)Kaz Kylheku
| | |  | |      `- Re: Always use "--" (Was: Long filenames in DOS/Windows and Unix/Linux)Lew Pitcher
| | |  | `- Re: Long filenames in DOS/Windows and Unix/LinuxTim Rentsch
| | |  +* Re: Long filenames in DOS/Windows and Unix/LinuxKaz Kylheku
| | |  |+* Re: Long filenames in DOS/Windows and Unix/LinuxKeith Thompson
| | |  ||`* Re: Long filenames in DOS/Windows and Unix/LinuxLawrence D'Oliveiro
| | |  || `* Re: Long filenames in DOS/Windows and Unix/LinuxKeith Thompson
| | |  ||  +* Re: Long filenames in DOS/Windows and Unix/LinuxLawrence D'Oliveiro
| | |  ||  |`* Re: Long filenames in DOS/Windows and Unix/LinuxKeith Thompson
| | |  ||  | +- Re: Long filenames in DOS/Windows and Unix/LinuxLawrence D'Oliveiro
| | |  ||  | `- Re: Long filenames in DOS/Windows and Unix/LinuxNuno Silva
| | |  ||  `- Re: Long filenames in DOS/Windows and Unix/LinuxKaz Kylheku
| | |  |`* Re: Long filenames in DOS/Windows and Unix/LinuxJohn Ames
| | |  | `- Re: Long filenames in DOS/Windows and Unix/LinuxMuttley
| | |  `* Re: Long filenames in DOS/Windows and Unix/LinuxRichard Kettlewell
| | |   `* Re: Long filenames in DOS/Windows and Unix/LinuxRalf Fassel
| | |    +* Re: Long filenames in DOS/Windows and Unix/LinuxRichard Kettlewell
| | |    |`* Re: Long filenames in DOS/Windows and Unix/Linuxcandycanearter07
| | |    | `- Word splitting oddities (Was: Long filenames in DOS/Windows and Unix/Linux)Kenny McCormack
| | |    `- Re: Long filenames in DOS/Windows and Unix/LinuxJanis Papanagnou
| | `- Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin)Janis Papanagnou
| `- Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping toMuttley
`- Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to stdin)Marcel Mueller

Pages:123
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Keith Thompson
Newsgroups: comp.unix.programmer
Organization: None to speak of
Date: Tue, 3 Sep 2024 23:10 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Tue, 03 Sep 2024 16:10:42 -0700
Organization: None to speak of
Lines: 22
Message-ID: <87o7541ggd.fsf@nosuchdomain.example.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com>
<20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com>
<20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
<87seug1iyj.fsf@nosuchdomain.example.com>
<vb81vo$3g6hb$6@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 04 Sep 2024 01:10:43 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0c8cc2609bc8d9fbbbb3d106ce45f413";
logging-data="3698149"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18QcHpam1syD8ibPr5MVXGR"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:a6oZh3hcRXfeggPHlKstMsb2InY=
sha1:NfI0G1MzmFupDR80OwvZYuS0dnk=
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> On Tue, 03 Sep 2024 15:16:36 -0700, Keith Thompson wrote:
>> For example, I might type something like:
>>
>> for file in * ; do cp -p $file $file.bak ; done
>
> It’s quite easy to fix that to work with spaces in file names.

I wouldn't call it "quite easy". Certainly it can be done, and I do it
when I need to. My point is that there is an advantage in being able to
avoid the extra effort when I know it's not needed.

How would you do it?

> How long
> have you been working with *nix shells?

A long time. I might consider being more specific later.

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

Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Kaz Kylheku
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Tue, 3 Sep 2024 23:15 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-1753@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Tue, 3 Sep 2024 23:15:46 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 71
Message-ID: <20240903155649.659@kylheku.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com>
<20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com>
<20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
<87seug1iyj.fsf@nosuchdomain.example.com>
Injection-Date: Wed, 04 Sep 2024 01:15:46 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="2b69e3d83e73f0011c7c1e15634565f6";
logging-data="3696002"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+WsJCPtoda8aJVwDJR99/bpYkbzcgEYyY="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:r9xMrcD6UrzYt1sJr6Iv6wVtBxg=
View all headers

On 2024-09-03, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
> John Ames <commodorejohn@gmail.com> writes:
>> On Tue, 3 Sep 2024 20:11:28 -0000 (UTC)
>> Kaz Kylheku <643-408-1753@kylheku.com> wrote:
>>
>>> Because it is based on a strawman interpretation of the "no spaces"
>>> rule. That strawman interpretation is that there are no other rules
>>> used in combination with the "no spaces" rule, and thus that any
>>> ridiculous name is fine, just as long as it doesn't contain spaces.
>>>
>>> And so, look how unreadable is this 100 character name in CamelCase!
>>> Q.E.D. no spaces is a bad recommendation!
>>
>> Well, there were no other factors *presented* alongside the blanket
>> statement that spaces in filenames are unnecessary, so it would appear
>> on the face of it to be an accurate assessment of the claim being made,
>> which wasn't in a post of yours to begin with.
>>
>> And I'd still like to know who died and made whom king where filenames
>> and spaces therein are concrned.
>
> There is no official "rule" about spaces in filenames, though I can
> imagine easily imagine that some organizations and projects have
> rules forbidding them. A couple of data points: The gcc git repo
> contains 137394 files and none of them have spaces in their names.

The GCC project is Makefile-based.

The make utility has no support for paths with spaces.

Use of make is a great repellant against spaces in names.

If a make variable contains spaces, there is no way to quote it within
make. There is no way to express a prerequisite or target name with
spaces. GNU Make text processing constructs like $(foreach ...)
don't deal with spaces; there is no way for them to identify items
that contain spaces.

> The Linux kernel git repo contains 85803 files, and exactly one has
> spaces in its name.

You can bet it's one that's not referenced in any Makefile.

> Spaces in file names are likely not to be an issue if you interact
> with the filesystem via a GUI like Windows Explorer *or* if you use
> a scripting language like Perl or Python that requires strings used
> as filenames to be enclosed in quotation marks. In those contexts,
> space is just another character.

The buffoons that use spaces in document names in GUIs will find some
way to confuse themselves, like typing two spaces instead of one, or
quoting names to each other in e-mails without enough delimitation or
use of typeface to know which words are part of the name and which are
surrounding text.

E.g.

A: "Can you send the file analysis and report to me?"
B: "I will report to you, but I can't find the file analysis."
A: "No, the file is called analysis and report. :) Send that to me."

If you follow the convention that name of a file is one word that
contains no leading or trailing punctuation, then you can use it in
written sentences without ambiguity or quotes around it.
You can put a period or comma after it, and know that it can't
be part of the name since it would constitute trailing punctuation.

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

Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Keith Thompson
Newsgroups: comp.unix.programmer
Organization: None to speak of
Date: Tue, 3 Sep 2024 23:38 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Tue, 03 Sep 2024 16:38:06 -0700
Organization: None to speak of
Lines: 15
Message-ID: <87jzfs1f6p.fsf@nosuchdomain.example.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com>
<20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com>
<20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
<87seug1iyj.fsf@nosuchdomain.example.com>
<20240903155649.659@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Wed, 04 Sep 2024 01:38:07 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0c8cc2609bc8d9fbbbb3d106ce45f413";
logging-data="3698149"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/xJQWOeiIDYVjHyvhrvyCq"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:9qYbWjuJJCrMKVU09vexxnoB8Ic=
sha1:0HeBY85gQST5+PStpGF4JW8ZhrA=
View all headers

Kaz Kylheku <643-408-1753@kylheku.com> writes:
[...]
> The make utility has no support for paths with spaces.

Looks like you're right. This bug report is 22 years old:

https://savannah.gnu.org/bugs/?712

I'm mildly amused by the fact that I've never noticed this before.

[snip]

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

Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Lawrence D'Oliv
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Tue, 3 Sep 2024 23:54 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Tue, 3 Sep 2024 23:54:35 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <vb87jr$3h6uk$1@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com>
<20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com>
<20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
<87seug1iyj.fsf@nosuchdomain.example.com> <vb81vo$3g6hb$6@dont-email.me>
<87o7541ggd.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 04 Sep 2024 01:54:35 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="176f5fbfb5d1157be6fd816dae78eee8";
logging-data="3709908"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18vLokVu6kIPI/cMhW4Q5Ud"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:akmmyv0VooJJg6/5vGu0FBtjwPs=
View all headers

On Tue, 03 Sep 2024 16:10:42 -0700, Keith Thompson wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>
>> On Tue, 03 Sep 2024 15:16:36 -0700, Keith Thompson wrote:
>>>
>>> For example, I might type something like:
>>>
>>> for file in * ; do cp -p $file $file.bak ; done
>>
>> It’s quite easy to fix that to work with spaces in file names.
>
> I wouldn't call it "quite easy".

As easy as this, in Bash at least:

IFS=$'\n'

I’ve been told elsewhere that $'\n' is also valid in the latest Posix
spec.

Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Lawrence D'Oliv
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Tue, 3 Sep 2024 23:56 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Tue, 3 Sep 2024 23:56:55 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <vb87o7$3h6uk$2@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com>
<20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com>
<20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
<87seug1iyj.fsf@nosuchdomain.example.com> <20240903155649.659@kylheku.com>
<87jzfs1f6p.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 04 Sep 2024 01:56:56 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="176f5fbfb5d1157be6fd816dae78eee8";
logging-data="3709908"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18aoQAvFTPjkPXWiMyuD7hh"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:lh0iQ8MU4K3I0xPCCpY7067YHxE=
View all headers

On Tue, 03 Sep 2024 16:38:06 -0700, Keith Thompson wrote:

>> The make utility has no support for paths with spaces.
>
> Looks like you're right.

I have some Makefiles with spaces in the dependency names, of the form:

target\ name\ with\ space : source\ name\ with\ space

Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Keith Thompson
Newsgroups: comp.unix.programmer
Organization: None to speak of
Date: Wed, 4 Sep 2024 00:19 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Tue, 03 Sep 2024 17:19:17 -0700
Organization: None to speak of
Lines: 26
Message-ID: <87frqg1da2.fsf@nosuchdomain.example.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com>
<20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com>
<20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
<87seug1iyj.fsf@nosuchdomain.example.com>
<20240903155649.659@kylheku.com>
<87jzfs1f6p.fsf@nosuchdomain.example.com>
<vb87o7$3h6uk$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 04 Sep 2024 02:19:17 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0c8cc2609bc8d9fbbbb3d106ce45f413";
logging-data="3715429"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+I8u3FjVm6uCuNpU48yFMe"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:aQZpL0WuyZf3VbVSwT9flqj/F6M=
sha1:6mJ0JGYmA06aTgfLCBJ/i02cPYY=
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> On Tue, 03 Sep 2024 16:38:06 -0700, Keith Thompson wrote:
>>> The make utility has no support for paths with spaces.
>>
>> Looks like you're right.
>
> I have some Makefiles with spaces in the dependency names, of the form:
>
> target\ name\ with\ space : source\ name\ with\ space

I'd be interested in knowing how you do that.

$ cat Makefile
foo\ bar: foo\ bar.c
$ make
cc foo bar.c -o foo bar
cc: fatal error: input file ‘foo’ is the same as output file
compilation terminated.
make: *** [<builtin>: foo bar] Error 1
$

I'm using GNU Make 4.3.

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

Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Keith Thompson
Newsgroups: comp.unix.programmer
Organization: None to speak of
Date: Wed, 4 Sep 2024 00:27 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Tue, 03 Sep 2024 17:27:34 -0700
Organization: None to speak of
Lines: 50
Message-ID: <87bk141cw9.fsf@nosuchdomain.example.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com>
<20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com>
<20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
<87seug1iyj.fsf@nosuchdomain.example.com>
<vb81vo$3g6hb$6@dont-email.me>
<87o7541ggd.fsf@nosuchdomain.example.com>
<vb87jr$3h6uk$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 04 Sep 2024 02:27:35 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0c8cc2609bc8d9fbbbb3d106ce45f413";
logging-data="3715429"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/1nYAlNXrYtjmYHEeUugz2"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:Nb539IpoZKD2E4jYxSJBg1/V/nI=
sha1:kINmlKWkJqr3Xdup2PUIDYs20DU=
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> On Tue, 03 Sep 2024 16:10:42 -0700, Keith Thompson wrote:
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>> On Tue, 03 Sep 2024 15:16:36 -0700, Keith Thompson wrote:
>>>> For example, I might type something like:
>>>>
>>>> for file in * ; do cp -p $file $file.bak ; done
>>>
>>> It’s quite easy to fix that to work with spaces in file names.
>>
>> I wouldn't call it "quite easy".
>
> As easy as this, in Bash at least:
>
> IFS=$'\n'
>
> I’ve been told elsewhere that $'\n' is also valid in the latest Posix
> spec.

Not bad -- but of course that's not all you have to do.

I tried it just now. My first attempt was

IFS='\n' for file in * ; do cp -p $file $file.bak ; done

but that's a syntax error ("for" is a shell keyword, not a command).
Second attempt:

IFS='\n' ; for file in * ; do cp -p $file $file.bak ; done

but that leaves IFS set to its new value in my interactive shell.

Either of these seems to work:

( IFS='\n' ; for file in * ; do cp -p $file $file.bak ; done )

{ IFS='\n' ; for file in * ; do cp -p $file $file.bak ; done }

That's still more trouble than it's worth *for me*. It handles
99+% of real-world cases, but I expect it would fail if a file had
a newline in its name. (Actually a quick experiment indicates that
that seems to work. I don't know how or why.) I have other ways of
handling this kind of thing if I need 100% reliability regardless of
any funny characters in file names (Perl, readdir). And the simple
"for file in *" handles 99% of the cases that I personally have to
deal with.

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

Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Tim Rentsch
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 4 Sep 2024 00:35 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17687@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Tue, 03 Sep 2024 17:35:35 -0700
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <86wmjsntm0.fsf@linuxsc.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com> <ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me> <ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com> <vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com> <20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com> <20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com> <87seug1iyj.fsf@nosuchdomain.example.com> <vb81vo$3g6hb$6@dont-email.me> <87o7541ggd.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Wed, 04 Sep 2024 02:35:35 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="24eb7fe042a4b91b667bdd96799998d3";
logging-data="3717518"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+BqQbTZl8uL3bZlnzJlDjMHjQ9JyJdzPg="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:2M5dxGCp1nYtarXfqFA6ZVfCMhs=
sha1:O7CmGj+cLij69v8N4sen4ByrQDg=
View all headers

Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
>> How long have you been working with *nix shells?
>
> A long time. [...]

My answer is not very long; less than 50 years.

Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Lawrence D'Oliv
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 4 Sep 2024 00:41 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Wed, 4 Sep 2024 00:41:55 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <vb8aci$3hhg4$1@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com>
<20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com>
<20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
<87seug1iyj.fsf@nosuchdomain.example.com> <20240903155649.659@kylheku.com>
<87jzfs1f6p.fsf@nosuchdomain.example.com> <vb87o7$3h6uk$2@dont-email.me>
<87frqg1da2.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 04 Sep 2024 02:41:55 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="176f5fbfb5d1157be6fd816dae78eee8";
logging-data="3720708"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX183ZyUdmEsBXHWVhknCdPbd"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:aB98d3e2H8GyGxV0ODcHUWqtChc=
View all headers

On Tue, 03 Sep 2024 17:19:17 -0700, Keith Thompson wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
>> I have some Makefiles with spaces in the dependency names, of the form:
>>
>> target\ name\ with\ space : source\ name\ with\ space
>
> I'd be interested in knowing how you do that.
>
> $ cat Makefile foo\ bar: foo\ bar.c
> $ make cc foo bar.c -o foo bar
> cc: fatal error: input file ‘foo’ is the same as output file
> compilation terminated.

The Makefiles in question are not using the default build rules for C
code: they are building other things, with explicit use of the "$<" and
"$@" variable substitutions.

Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Lawrence D'Oliv
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 4 Sep 2024 00:44 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Wed, 4 Sep 2024 00:44:39 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <vb8ahn$3hhg4$2@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com>
<20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com>
<20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
<87seug1iyj.fsf@nosuchdomain.example.com> <vb81vo$3g6hb$6@dont-email.me>
<87o7541ggd.fsf@nosuchdomain.example.com> <vb87jr$3h6uk$1@dont-email.me>
<87bk141cw9.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 04 Sep 2024 02:44:39 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="176f5fbfb5d1157be6fd816dae78eee8";
logging-data="3720708"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4w21lz3yRUH/7mzo++MF3"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:4V94rqL3o11lQa2fMR1zYW5OeaI=
View all headers

On Tue, 03 Sep 2024 17:27:34 -0700, Keith Thompson wrote:

> Second attempt:
>
> IFS='\n' ; for file in * ; do cp -p $file $file.bak ; done
>
> but that leaves IFS set to its new value in my interactive shell.

Which in my experience is no biggie.

Next step: what if you wanted to handle newlines in file names as well?

Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Keith Thompson
Newsgroups: comp.unix.programmer
Organization: None to speak of
Date: Wed, 4 Sep 2024 04:29 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Tue, 03 Sep 2024 21:29:24 -0700
Organization: None to speak of
Lines: 25
Message-ID: <877cbs11p7.fsf@nosuchdomain.example.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com>
<20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com>
<20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
<87seug1iyj.fsf@nosuchdomain.example.com>
<20240903155649.659@kylheku.com>
<87jzfs1f6p.fsf@nosuchdomain.example.com>
<vb87o7$3h6uk$2@dont-email.me>
<87frqg1da2.fsf@nosuchdomain.example.com>
<vb8aci$3hhg4$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 04 Sep 2024 06:29:29 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0c8cc2609bc8d9fbbbb3d106ce45f413";
logging-data="3897102"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+HGZYr+XAsrHryPWCiSsun"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:kHeyLWZZKkpnO5s2AoRggvqb63A=
sha1:5CuMGNog9Nf+4QVEJy4k3sQaSG0=
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> On Tue, 03 Sep 2024 17:19:17 -0700, Keith Thompson wrote:
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>> I have some Makefiles with spaces in the dependency names, of the form:
>>>
>>> target\ name\ with\ space : source\ name\ with\ space
>>
>> I'd be interested in knowing how you do that.
>>
>> $ cat Makefile foo\ bar: foo\ bar.c
>> $ make cc foo bar.c -o foo bar
>> cc: fatal error: input file ‘foo’ is the same as output file
>> compilation terminated.
>
> The Makefiles in question are not using the default build rules for C
> code: they are building other things, with explicit use of the "$<" and
> "$@" variable substitutions.

I'd still be interested in seeing an example. In a quick experiment,
I wasn't able to get GNU Make to recognize the existence of a file named
"foo bar".

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

Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Keith Thompson
Newsgroups: comp.unix.programmer
Organization: None to speak of
Date: Wed, 4 Sep 2024 04:36 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Tue, 03 Sep 2024 21:36:48 -0700
Organization: None to speak of
Lines: 30
Message-ID: <8734mg11cv.fsf@nosuchdomain.example.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com>
<20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com>
<20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
<87seug1iyj.fsf@nosuchdomain.example.com>
<vb81vo$3g6hb$6@dont-email.me>
<87o7541ggd.fsf@nosuchdomain.example.com>
<vb87jr$3h6uk$1@dont-email.me>
<87bk141cw9.fsf@nosuchdomain.example.com>
<vb8ahn$3hhg4$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Wed, 04 Sep 2024 06:36:48 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0c8cc2609bc8d9fbbbb3d106ce45f413";
logging-data="3897102"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18c3eMjKS8qup+Fo+cOMiCE"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:d4Rip3hpXTBYJS7bXOok8WMuRmE=
sha1:6jkPEyY3Beect8J75sX5UGLn1Fo=
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> On Tue, 03 Sep 2024 17:27:34 -0700, Keith Thompson wrote:
>> Second attempt:
>>
>> IFS='\n' ; for file in * ; do cp -p $file $file.bak ; done
>>
>> but that leaves IFS set to its new value in my interactive shell.
>
> Which in my experience is no biggie.

Perhaps. Honestly, I've never paid enough attention to IFS to have any
confidence in doing anything other than leaving it alone.

> Next step: what if you wanted to handle newlines in file names as well?

Either `find ... -print0 | xargs -0 ...` or a quick Perl script.

opendir my $DIR, '.' or die ".: $!\n";
foreach my $file(grep { $_ ne '.' and $_ ne '..' } readdir $DIR) {
system 'cp', '-p', $file, "$file.bak";
# error checking omitted for now
}
closedir $DIR;

(I'm not arguing that Perl is the best or only language for this; it
just happens to be what I'm most familiar with.)

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

Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Lawrence D'Oliv
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 4 Sep 2024 06:49 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Wed, 4 Sep 2024 06:49:16 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <vb8vtc$3ntvj$1@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com>
<20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com>
<20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
<87seug1iyj.fsf@nosuchdomain.example.com> <20240903155649.659@kylheku.com>
<87jzfs1f6p.fsf@nosuchdomain.example.com> <vb87o7$3h6uk$2@dont-email.me>
<87frqg1da2.fsf@nosuchdomain.example.com> <vb8aci$3hhg4$1@dont-email.me>
<877cbs11p7.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 04 Sep 2024 08:49:16 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="176f5fbfb5d1157be6fd816dae78eee8";
logging-data="3930099"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19QCCrGxyq7vAe7fxn4iLlr"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:pb24vXCWWsbBKK0Or7+PbBlJ7GQ=
View all headers

On Tue, 03 Sep 2024 21:29:24 -0700, Keith Thompson wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
>> The Makefiles in question are not using the default build rules for C
>> code: they are building other things, with explicit use of the "$<" and
>> "$@" variable substitutions.
>
> I'd still be interested in seeing an example.

Here’s one I whipped up:

--
output\ file : input\ file
cp "$<" "$@"

input\ file : /dev/null
cp "$<" "$@"
--

If the tabs don’t make it across, you know where they should go. ;)

Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Lawrence D'Oliv
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 4 Sep 2024 07:05 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Wed, 4 Sep 2024 07:05:38 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <vb90s2$3o2de$1@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com>
<20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com>
<20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
<87seug1iyj.fsf@nosuchdomain.example.com> <vb81vo$3g6hb$6@dont-email.me>
<87o7541ggd.fsf@nosuchdomain.example.com> <vb87jr$3h6uk$1@dont-email.me>
<87bk141cw9.fsf@nosuchdomain.example.com> <vb8ahn$3hhg4$2@dont-email.me>
<8734mg11cv.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 04 Sep 2024 09:05:39 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="176f5fbfb5d1157be6fd816dae78eee8";
logging-data="3934638"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19C3Tkzkye1U8eXviIuDxOu"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:l+OEp9cMYbgd0OeeDl6LKB89e/A=
View all headers

On Tue, 03 Sep 2024 21:36:48 -0700, Keith Thompson wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
>> Next step: what if you wanted to handle newlines in file names as well?
>
> Either `find ... -print0 | xargs -0 ...` or a quick Perl script.

Sure, it’s much easier in Perl or Python or some other such programming-
oriented (as opposed to command-oriented) language. But it can be done in
Bash.

The thing is, while find is handy for getting the matching file names,
xargs is not always the most convenient way of processing them. You often
just want to be able to do “for f in «filenames»; do «whatever» done”,
e.g.:

collect_expand «wildcard» found_filenames
for f in "${found_filenames[@]}"; do
echo "found" $(printf %q "$f")
done

That “collect_expand” is a Bash function. Do you want to figure out how to
write it, before I post my solution? ;)

Subject: Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 4 Sep 2024 07:27 UTC
References: 1 2 3 4 5
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to
Date: Wed, 4 Sep 2024 07:27:49 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <vb925l$3oa4b$1@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com> <vaubbo$1d324$1@news.xmission.com> <vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com> <vb7ccs$1hcps$1@news.xmission.com>
Injection-Date: Wed, 04 Sep 2024 09:27:49 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="37739d3d5fcdae2aede8678d1d7dbc6b";
logging-data="3942539"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+izaDDovnmVQWlN62EKvEm"
Cancel-Lock: sha1:NQZEGJX7a4i4KzyDAszjXr6d+78=
View all headers

On Tue, 3 Sep 2024 16:10:04 -0000 (UTC)
gazelle@shell.xmission.com (Kenny McCormack) boringly babbled:
>In article <20240903084440.0000663d@gmail.com>,
>John Ames <commodorejohn@gmail.com> wrote:
>>On Sat, 31 Aug 2024 08:37:01 -0000 (UTC)
>>Muttley@dastardlyhq.com wrote:
>>
>>> On Sat, 31 Aug 2024 05:57:12 -0000 (UTC)
>>> gazelle@shell.xmission.com (Kenny McCormack) gabbled:
>>> > 2) Spaces in filenames are pretty much a necessity from the
>>> > end-user
>>>
>>> No they're not.
>>
>>WhoNeedsSpacesWhenYouCanJustCapitalizeEveryWordAsAVisualSignifierAmIRight
>>or-alternatively-make-liberal-use-of-dashes
>>or_use_underscores_like_some_deranged_freak
>>
>>Very readable and not at *all* weird or clunky!
>>
>
>I love this post.
>
>Yeah, you got it exactly. Note that users really hate underscores. They

Can you link to the survey which shows this.

Subject: Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 4 Sep 2024 07:31 UTC
References: 1 2 3 4 5 6 7
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to
Date: Wed, 4 Sep 2024 07:31:13 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <vb92c1$3ob9j$1@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com>
<ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me>
<vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me>
<20240903084440.0000663d@gmail.com>
Injection-Date: Wed, 04 Sep 2024 09:31:14 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="37739d3d5fcdae2aede8678d1d7dbc6b";
logging-data="3943731"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/KA17O/eyZ7nvpd8fD0Us4"
Cancel-Lock: sha1:s/oUuK+o2dUCDsaVe8j9Km/hJjM=
View all headers

On Tue, 3 Sep 2024 08:44:40 -0700
John Ames <commodorejohn@gmail.com> boringly babbled:
>On Sat, 31 Aug 2024 08:37:01 -0000 (UTC)
>Muttley@dastardlyhq.com wrote:
>
>> On Sat, 31 Aug 2024 05:57:12 -0000 (UTC)
>> gazelle@shell.xmission.com (Kenny McCormack) gabbled:
>> > 2) Spaces in filenames are pretty much a necessity from the
>> > end-user
>>
>> No they're not.
>
>WhoNeedsSpacesWhenYouCanJustCapitalizeEveryWordAsAVisualSignifierAmIRight
>or-alternatively-make-liberal-use-of-dashes
>or_use_underscores_like_some_deranged_freak
>
>Very readable and not at *all* weird or clunky!

The camel case isn't great, but the dashes and underscores look fine to me.

Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Nuno Silva
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 4 Sep 2024 09:16 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nunojsilva@invalid.invalid (Nuno Silva)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Wed, 04 Sep 2024 10:16:54 +0100
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <vb98i6$3pdv5$1@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com>
<20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com>
<20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
<87seug1iyj.fsf@nosuchdomain.example.com>
<20240903155649.659@kylheku.com>
<87jzfs1f6p.fsf@nosuchdomain.example.com>
<vb87o7$3h6uk$2@dont-email.me>
<87frqg1da2.fsf@nosuchdomain.example.com>
<vb8aci$3hhg4$1@dont-email.me>
<877cbs11p7.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 04 Sep 2024 11:16:54 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="bf3903c93f73533d3efb0e0124570cd3";
logging-data="3979237"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19cMusLBm3sDO/q2woNyVYX"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
Cancel-Lock: sha1:J0fnIdH+xYSsDRFE3iCfXSc+j5o=
View all headers

On 2024-09-04, Keith Thompson wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>> On Tue, 03 Sep 2024 17:19:17 -0700, Keith Thompson wrote:
>>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>>> I have some Makefiles with spaces in the dependency names, of the form:
>>>>
>>>> target\ name\ with\ space : source\ name\ with\ space
>>>
>>> I'd be interested in knowing how you do that.
>>>
[I tried to restore the newlines at the appropriate places here, I hope
I got these right:]
>>> $ cat Makefile
>>> foo\ bar: foo\ bar.c
>>> $ make
>>> cc foo bar.c -o foo bar
>>> cc: fatal error: input file ‘foo’ is the same as output file
>>> compilation terminated.
>>
>> The Makefiles in question are not using the default build rules for C
>> code: they are building other things, with explicit use of the "$<" and
>> "$@" variable substitutions.
>
> I'd still be interested in seeing an example. In a quick experiment,
> I wasn't able to get GNU Make to recognize the existence of a file named
> "foo bar".

But, in your output, what is having trouble is the compiler invocation,
not make itself processing the files (although that then *is* a problem
with make's implicit rules and their ability to handle spaces).

Or do you mean there is also a problem with detecting the presence or
absence of files with spaces in their names?

--
Nuno Silva

Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Ralf Fassel
Newsgroups: comp.unix.programmer
Date: Wed, 4 Sep 2024 09:47 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ralfixx@gmx.de (Ralf Fassel)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Wed, 04 Sep 2024 11:47:53 +0200
Lines: 27
Message-ID: <yga34mfoily.fsf@akutech.de>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com>
<20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com>
<20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
<87seug1iyj.fsf@nosuchdomain.example.com>
<vb81vo$3g6hb$6@dont-email.me>
<87o7541ggd.fsf@nosuchdomain.example.com>
<vb87jr$3h6uk$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net htmwqWWA8HbBwhqaopRmzwAAG5KxGqzmxm2fA7OYFutIj6/XY=
Cancel-Lock: sha1:CrBV37DeTWVCA4qo3WwvGpZsV2g= sha1:Tsi67MWAvRKqnAvT2SNHPEECPIY= sha256:/dp9bKFV84Zh26ljImd6FT798orwsLhnAROVZ23NdBw=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
View all headers

* Lawrence D'Oliveiro <ldo@nz.invalid>
| On Tue, 03 Sep 2024 16:10:42 -0700, Keith Thompson wrote:
>
| > Lawrence D'Oliveiro <ldo@nz.invalid> writes:
| >>
| >> On Tue, 03 Sep 2024 15:16:36 -0700, Keith Thompson wrote:
| >>>
| >>> For example, I might type something like:
| >>>
| >>> for file in * ; do cp -p $file $file.bak ; done
| >>
| >> It’s quite easy to fix that to work with spaces in file names.
| >
| > I wouldn't call it "quite easy".
>
| As easy as this, in Bash at least:
>
| IFS=$'\n'

Forgive my ignorance, but what is wrong with

for file in * ; do cp -p "$file" "$file.bak" ; done

? Works for both spaces and newlines in file names... (at least with
bash and ksh).

R'

Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Keith Thompson
Newsgroups: comp.unix.programmer
Organization: None to speak of
Date: Wed, 4 Sep 2024 10:44 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Wed, 04 Sep 2024 03:44:32 -0700
Organization: None to speak of
Lines: 36
Message-ID: <87ttevzoj3.fsf@nosuchdomain.example.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com>
<20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com>
<20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
<87seug1iyj.fsf@nosuchdomain.example.com>
<vb81vo$3g6hb$6@dont-email.me>
<87o7541ggd.fsf@nosuchdomain.example.com>
<vb87jr$3h6uk$1@dont-email.me> <yga34mfoily.fsf@akutech.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 04 Sep 2024 12:44:33 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0c8cc2609bc8d9fbbbb3d106ce45f413";
logging-data="4005717"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/i/gdMUTJ8tlF7JBmGiwcB"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:GQl2aTTgOwyaG3urOkP0tDJhB0k=
sha1:e88zPxww5gmFj21G1yZdFPpgwiA=
View all headers

Ralf Fassel <ralfixx@gmx.de> writes:
> * Lawrence D'Oliveiro <ldo@nz.invalid>
> | On Tue, 03 Sep 2024 16:10:42 -0700, Keith Thompson wrote:
>>
> | > Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> | >>
> | >> On Tue, 03 Sep 2024 15:16:36 -0700, Keith Thompson wrote:
> | >>>
> | >>> For example, I might type something like:
> | >>>
> | >>> for file in * ; do cp -p $file $file.bak ; done
> | >>
> | >> It’s quite easy to fix that to work with spaces in file names.
> | >
> | > I wouldn't call it "quite easy".
>>
> | As easy as this, in Bash at least:
>>
> | IFS=$'\n'
>
> Forgive my ignorance, but what is wrong with
>
> for file in * ; do cp -p "$file" "$file.bak" ; done
>
> ? Works for both spaces and newlines in file names... (at least with
> bash and ksh).

You're absolutely right. I'm not sure how I missed that. (I was
thinking that * just expands to a string, but that's obviously not the
case.)

D'oh!

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

Subject: User surveys (Was: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to)
From: Kenny McCormack
Newsgroups: comp.unix.programmer
Organization: The official candy of the new Millennium
Date: Wed, 4 Sep 2024 11:27 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.programmer
Subject: User surveys (Was: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to)
Date: Wed, 4 Sep 2024 11:27:14 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <vb9g6i$1if17$1@news.xmission.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com> <20240903084440.0000663d@gmail.com> <vb7ccs$1hcps$1@news.xmission.com> <vb925l$3oa4b$1@dont-email.me>
Injection-Date: Wed, 4 Sep 2024 11:27:14 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="1653799"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
View all headers

In article <vb925l$3oa4b$1@dont-email.me>, <Muttley@dastardlyhq.com> wrote:
....
>>Yeah, you got it exactly. Note that users really hate underscores. They
>
>Can you link to the survey which shows this.

I'm not aware of any such surveys. Are you?

--
Never, ever, ever forget that "Both sides do it" is strictly a Republican meme.

It is always the side that sucks that insists on saying "Well, you suck, too".

Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Nuno Silva
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 4 Sep 2024 12:33 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nunojsilva@invalid.invalid (Nuno Silva)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Wed, 04 Sep 2024 13:33:25 +0100
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <vb9k2l$3r705$1@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com>
<20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com>
<20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
<87seug1iyj.fsf@nosuchdomain.example.com>
<vb81vo$3g6hb$6@dont-email.me>
<87o7541ggd.fsf@nosuchdomain.example.com>
<vb87jr$3h6uk$1@dont-email.me> <yga34mfoily.fsf@akutech.de>
<87ttevzoj3.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 04 Sep 2024 14:33:26 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="bf3903c93f73533d3efb0e0124570cd3";
logging-data="4037637"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/mEOSDEHvjLFBkMdBV8bq5"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
Cancel-Lock: sha1:6DP4miAfbuMMDzE9cJYJLfe66S4=
View all headers

On 2024-09-04, Keith Thompson wrote:

> Ralf Fassel <ralfixx@gmx.de> writes:
>> * Lawrence D'Oliveiro <ldo@nz.invalid>
>> | On Tue, 03 Sep 2024 16:10:42 -0700, Keith Thompson wrote:
>>>
>> | > Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>> | >>
>> | >> On Tue, 03 Sep 2024 15:16:36 -0700, Keith Thompson wrote:
>> | >>>
>> | >>> For example, I might type something like:
>> | >>>
>> | >>> for file in * ; do cp -p $file $file.bak ; done
>> | >>
>> | >> It’s quite easy to fix that to work with spaces in file names.
>> | >
>> | > I wouldn't call it "quite easy".
>>>
>> | As easy as this, in Bash at least:
>>>
>> | IFS=$'\n'
>>
>> Forgive my ignorance, but what is wrong with
>>
>> for file in * ; do cp -p "$file" "$file.bak" ; done
>>
>> ? Works for both spaces and newlines in file names... (at least with
>> bash and ksh).
>
> You're absolutely right. I'm not sure how I missed that. (I was
> thinking that * just expands to a string, but that's obviously not the
> case.)
>
> D'oh!

(Along with these quotes, I'd add ./ before $file.)

--
Nuno Silva

Subject: Always use "--" (Was: Long filenames in DOS/Windows and Unix/Linux)
From: Kenny McCormack
Newsgroups: comp.unix.programmer
Organization: The official candy of the new Millennium
Date: Wed, 4 Sep 2024 13:04 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.programmer
Subject: Always use "--" (Was: Long filenames in DOS/Windows and Unix/Linux)
Date: Wed, 4 Sep 2024 13:04:07 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <vb9ls7$1igeo$1@news.xmission.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com> <yga34mfoily.fsf@akutech.de> <87ttevzoj3.fsf@nosuchdomain.example.com> <vb9k2l$3r705$1@dont-email.me>
Injection-Date: Wed, 4 Sep 2024 13:04:07 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="1655256"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
View all headers

In article <vb9k2l$3r705$1@dont-email.me>,
Nuno Silva <nunojsilva@invalid.invalid> wrote:
....
>> D'oh!
>
>(Along with these quotes, I'd add ./ before $file.)

Or, more simply, just put -- after the -p.

This is an often overlooked aspect of shell programing. You should always
use "--". The "shellcheck" program will tell you this, if you let it.

--
"Women should not be enlightened or educated in any way. They should be
segregated because they are the cause of unholy erections in holy men.

-- Saint Augustine (354-430) --

Subject: Re: User surveys (Was: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to)
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 4 Sep 2024 13:12 UTC
References: 1 2 3 4 5
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: User surveys (Was: Long filenames in DOS/Windows and Unix/Linux (Was: Piping to)
Date: Wed, 4 Sep 2024 13:12:27 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <vb9mbr$3rlq6$1@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com> <20240903084440.0000663d@gmail.com> <vb7ccs$1hcps$1@news.xmission.com> <vb925l$3oa4b$1@dont-email.me> <vb9g6i$1if17$1@news.xmission.com>
Injection-Date: Wed, 04 Sep 2024 15:12:27 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="37739d3d5fcdae2aede8678d1d7dbc6b";
logging-data="4052806"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18+3/7nHs4ftXa32MIbtEoc"
Cancel-Lock: sha1:ea4WLsV/y8FCUGQlB3+VN1rMcGc=
View all headers

On Wed, 4 Sep 2024 11:27:14 -0000 (UTC)
gazelle@shell.xmission.com (Kenny McCormack) boringly babbled:
>In article <vb925l$3oa4b$1@dont-email.me>, <Muttley@dastardlyhq.com> wrote:
>....
>>>Yeah, you got it exactly. Note that users really hate underscores. They
>>
>>Can you link to the survey which shows this.
>
>I'm not aware of any such surveys. Are you?

Which was my point so you have no way of knowing what users like or don't
like wtf to filenames other than whatever small group you've gone around
and actually asked.

Subject: Re: Always use "--" (Was: Long filenames in DOS/Windows and Unix/Linux)
From: Lew Pitcher
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 4 Sep 2024 13:17 UTC
References: 1 2 3 4 5
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitcher@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.programmer
Subject: Re: Always use "--" (Was: Long filenames in DOS/Windows and
Unix/Linux)
Date: Wed, 4 Sep 2024 13:17:48 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <vb9mls$3rk17$1@dont-email.me>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<yga34mfoily.fsf@akutech.de> <87ttevzoj3.fsf@nosuchdomain.example.com>
<vb9k2l$3r705$1@dont-email.me> <vb9ls7$1igeo$1@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 04 Sep 2024 15:17:49 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="089580a279695161dca4425bbd5038c9";
logging-data="4050983"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX180TaqU1wPBXvNKv+5H9E04ZBGUTHDeprM="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:XP0xZEezQsToG5l5zlq2YpzOg2k=
View all headers

On Wed, 04 Sep 2024 13:04:07 +0000, Kenny McCormack wrote:

> In article <vb9k2l$3r705$1@dont-email.me>,
> Nuno Silva <nunojsilva@invalid.invalid> wrote:
> ...
>>> D'oh!
>>
>>(Along with these quotes, I'd add ./ before $file.)
>
> Or, more simply, just put -- after the -p.
>
> This is an often overlooked aspect of shell programing. You should always
> use "--". The "shellcheck" program will tell you this, if you let it.

The "--" option is just that, an option coded into the argument parser of
the program being invoked. Many programs /do not/ recognize "--" as an
"end of flags" argument, so the effectiveness of "--" is unreliable.

OTOH, if you specify a fully qualified pathname, (or, at least, a qualified
relative pathname), you can assure yourself that the file path provided
to the program /will not/ start with the '-' that indicates a program flag.

Note that all this is /convention/ and not /requirement/. There are situations
in which /none/ of the above applies, as
a) the program interprets it's arguments by /position/, or
b) the program doesn't use the '-' to introduce flag arguments, or
c) the program doesn't take filenames as arguments, or
d) some other conditions that I'm too lazy to enumerate

HTH
--
Lew Pitcher
"In Skills We Trust"

Subject: Re: Long filenames in DOS/Windows and Unix/Linux
From: Kaz Kylheku
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 4 Sep 2024 14:30 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-1753@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.programmer
Subject: Re: Long filenames in DOS/Windows and Unix/Linux
Date: Wed, 4 Sep 2024 14:30:06 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <20240904071628.892@kylheku.com>
References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com>
<ubg6o7$3jrsn$1@news.xmission.com> <ubg853$2ssj8$1@dont-email.me>
<ubg8a8$2t20l$1@dont-email.me> <vaubbo$1d324$1@news.xmission.com>
<vauknd$uvji$1@dont-email.me> <20240903084440.0000663d@gmail.com>
<20240903103327.395@kylheku.com> <20240903113937.000008a3@gmail.com>
<20240903130000.933@kylheku.com> <20240903132547.00000656@gmail.com>
<87seug1iyj.fsf@nosuchdomain.example.com> <20240903155649.659@kylheku.com>
<87jzfs1f6p.fsf@nosuchdomain.example.com> <vb87o7$3h6uk$2@dont-email.me>
<87frqg1da2.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 04 Sep 2024 16:30:06 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="2b69e3d83e73f0011c7c1e15634565f6";
logging-data="4062119"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18cHpAmaoCeLa3V+EHqOpOr44zWVLehD8Q="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:ObuJdO3j0gwIJon+V2v8kWsQKjM=
View all headers

On 2024-09-04, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>> On Tue, 03 Sep 2024 16:38:06 -0700, Keith Thompson wrote:
>>>> The make utility has no support for paths with spaces.
>>>
>>> Looks like you're right.
>>
>> I have some Makefiles with spaces in the dependency names, of the form:
>>
>> target\ name\ with\ space : source\ name\ with\ space
>
> I'd be interested in knowing how you do that.
>
> $ cat Makefile
> foo\ bar: foo\ bar.c
> $ make
> cc foo bar.c -o foo bar
> cc: fatal error: input file ‘foo’ is the same as output file
> compilation terminated.
> make: *** [<builtin>: foo bar] Error 1

If you write your own rule in which $@ is quoted as '$@', it will
work, provided it doesn't contain ' characters.

It looks like there is limited support in GNU Make for backslash
escapes: they can be used on the prerequisite and target names
in a rule.

Elsewhere, other than backslash-newline continuations, backslashes
are literal.

So we can do:

FOOBAR := foo\ bar # literal backslash here

$(FOOBAR) : ... # backslash from variable interpolates here

Once the backslash is interpolated into the rule head, it becomes
active, so a single target "foo bar" is specified.

(Unfortunately, what GNU Make should be arguably be doing here is not
just treating foo\ bar as the single target foo bar but also
preserving the backslash so that the item is foo\ bar. Then it would
be possible for the implicit rule to work, because $@ would produce
foo\ bar which would be passed on to the shell, where the backslash
would do its job. One slight problem with that, though, is that the
interpreter for processing recipes is configurable; it doesn't have
to be a POSIX-like shell.)

Anyway, the FOOBAR variable is understood to contain two words, {foo\}
and {bar}. If we do a patsubst on it, it will match separately against
the two. Or foreach will iterate over two items. None of the text
processing stuff in GNU Make will recognize the backslash escape
as preventing word splitting.

Nontrivial Makefiles almost always work with lists, like at the
very least OBJS, SRCS and whatnot.

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

Pages:123

rocksolid light 0.9.8
clearnet tor