[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cope with spaces in an environment variable
From: |
Greg Wooledge |
Subject: |
Re: cope with spaces in an environment variable |
Date: |
Sun, 18 Jun 2023 23:20:36 -0400 |
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.
- 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