[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cope with spaces in an environment variable
From: |
Jeffrey Walton |
Subject: |
Re: cope with spaces in an environment variable |
Date: |
Mon, 19 Jun 2023 06:21:30 -0400 |
On Sun, Jun 18, 2023 at 11:21 PM Greg Wooledge <greg@wooledge.org> wrote:
>
> On Mon, Jun 19, 2023 at 12:09:35PM +0900, Masahiro Yamada wrote:
> > [2] With POSIX sh
> >
> > #!/bin/sh
> >
> > eval set -- "${CC}"
> > "$@" foo.c
> > "$@" bar.c
> > "$@" baz.c
>
> It would be less painful in the long run just to set your computer
> on fire now, and save yourself the long, slow descent into hell. And
> save the rest of the world from attacks initiated using your cracked
> systems, if they're Internet-connected.
>
> You mentioned Makefiles previously. Makefiles are used in software
> development, where a developer has absolute control over the names of
> files and directories within the project.
>
> In a Makefile, variables contain space-separated words. The syntax
> will simply fail if you try to use filenames with spaces in them. This
> is fine for developers, because no source code project uses filenames
> like that.
>
> Attempting to extend this sort of ivory-tower academic language into
> a real-world problem space, where end users have files and directories
> with spaces in their names, will not work.
>
> Trying to FORCE it to work with eval is going to end tragically.
++
Unix & Linux has never dealt with spaces in paths well, like Windows.
I would not try to use a path with spaces on Unix or Linux. It's like
trying to piss into the wind.
Rename the path so it does not have spaces.
Jeff
- cope with spaces in an environment variable, Masahiro Yamada, 2023/06/18
- Re: cope with spaces in an environment variable, Davide Brini, 2023/06/18
- Re: cope with spaces in an environment variable, alex xmb ratchev, 2023/06/18
- Re: cope with spaces in an environment variable, Lawrence Velázquez, 2023/06/18
- Re: cope with spaces in an environment variable, Kerin Millar, 2023/06/18
- Re: cope with spaces in an environment variable, Kerin Millar, 2023/06/19
- Re: cope with spaces in an environment variable, Kerin Millar, 2023/06/19