Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Aug 1995 17:45:44 +0200
From:      Wolfram Schneider <wosch@cs.tu-berlin.de>
To:        Garrett Wollman <wollman@halloran-eldar.lcs.mit.edu>
Cc:        current@freebsd.org
Subject:   make(1) extension for SHELL COMMANDS
Message-ID:  <199508141545.RAA13872@caramba.cs.tu-berlin.de>
In-Reply-To: <9508141535.AA11245@halloran-eldar.lcs.mit.edu>
References:  <199508132144.XAA25996@localhost> <9508141504.AA11190@halloran-eldar.lcs.mit.edu> <199508141513.RAA12434@caramba.cs.tu-berlin.de> <9508141535.AA11245@halloran-eldar.lcs.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Garrett Wollman writes:
><<On Mon, 14 Aug 1995 17:13:36 +0200, Wolfram Schneider <wosch@cs.tu-berlin.de> said:
>
>>> Very bad idea, and almost certainly contrary to P1003.2.
>
>> What says P1003.2 about /bin/sh?
>
>It's not what it says about the Bourne Shell that's relevant here,
>it's what it says about the `make' program.  In particular, it says
>that all commands are to be executed by means of `/bin/sh -c'.  

pmake use /bin/sh -c or /bin/sh -ec


    if (*cp != '\0') {
        /*
         * If *cp isn't the null character, we hit a "meta" character and
         * need to pass the command off to the shell. We give the shell the
         * -e flag as well as -c if it's supposed to exit when it hits an
         * error.
         */
        static char     *shargv[4] = { "/bin/sh" };

        shargv[1] = (errCheck ? "-ec" : "-c");
        shargv[2] = cmd;
        shargv[3] = (char *)NULL;
        av = shargv;
        argc = 0;
    } else {
        /*
         * No meta-characters, so no need to exec a shell. Break the command
         * into words to form an argument vector we can execute.
         * brk_string sticks our name in av[0], so we have to
         * skip over it...
         */
        av = brk_string(cmd, &argc, TRUE);


>Well, that's yet another way in which pmake is broken with respect to
>POSIX.  I'm not at all surprised to hear it.  We don't need to make
>the situation even worse than it already is.


Is POSIX a religion? I want a good OS ...

-Wolfram



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199508141545.RAA13872>