Arbitrary characters in filenames (was: Long filenames in DOS/Windows and Unix/Linux)

Liste des GroupesRevenir à cu shell 
Sujet : Arbitrary characters in filenames (was: Long filenames in DOS/Windows and Unix/Linux)
De : nn.throttle (at) *nospam* xoxy.net (Helmut Waitzmann)
Groupes : comp.unix.programmer comp.unix.shell
Suivi-à : comp.unix.shell
Date : 01. Sep 2024, 20:06:17
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <83jzfv5jvq.fsf_-_@helmutwaitzmann.news.arcor.de>
References : 1 2 3 4 5 6 7
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
 Lawrence D'Oliveiro <ldo@nz.invalid>:
On Sat, 31 Aug 2024 09:27:44 +0100, Richard Kettlewell wrote:
>
I think the thing that makes it hard is not the spaces as such, but the tooling that makes it inconvenient to handle them, which primarily means Bourne shell parsing rules. The problem basically ceases to exist once you’re outside the shell ecosystem. >
>
The rest of Unix has evolved substantially since the 1970s but shell is still stuck in this particular trap. It’s like we’re still making making arrowheads out of flint but everything else from steel. >
>
If you avoid newlines in filenames, Posix shells can cope with anything else if you set “IFS=$'\n'”. >
>
If you insist on wanting to accept those as well, then I don’t think Posix is enough, but Bash does have facilities that help you cope. >
 If one wants to cope with any character (including newline  characters) in the POSIX shell's command line, one could make use  of the apostroph quoting mechanism.  If one wants to process arbitrary (may be generated) lists of  filenames, one could make use of the "xargs" utility with option  "-0".  To generate those lists of filenames, there are     find ... -print0
 and    printf '%s\0' ...
 available.  Followup-To: comp.unix.shell
Date Sujet#  Auteur
1 Sep 24 * Re: Long filenames in DOS/Windows and Unix/Linux9Lawrence D'Oliveiro
1 Sep 24 +* Re: Long filenames in DOS/Windows and Unix/Linux7Lawrence D'Oliveiro
1 Sep 24 i+- Re: Long filenames in DOS/Windows and Unix/Linux1Nuno Silva
1 Sep 24 i+- Re: Long filenames in DOS/Windows and Unix/Linux1Helmut Waitzmann
1 Sep 24 i+- Putting arbitrary characters into the shell command line (was: Long filenames in DOS/Windows and Unix/Linux)1Helmut Waitzmann
3 Sep 24 i+* Re: Long filenames in DOS/Windows and Unix/Linux2Wayne
3 Sep 24 ii`- Re: Long filenames in DOS/Windows and Unix/Linux1Lawrence D'Oliveiro
8 Sep 24 i`- Re: Long filenames in DOS/Windows and Unix/Linux1Janis Papanagnou
1 Sep 24 `- Arbitrary characters in filenames (was: Long filenames in DOS/Windows and Unix/Linux)1Helmut Waitzmann

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal