Re: Handling of shell builtins in make(1)
From: Harti Brandt (hartmut.brandt_at_dlr.de)
Date: 05/24/05
- Previous message: Peter Jeremy: "Re: Handling of shell builtins in make(1)"
- In reply to: Peter Jeremy: "Re: Handling of shell builtins in make(1)"
- Next in thread: Sergey Babkin: "Re: Re: Handling of shell builtins in make(1)"
- Maybe reply: Sergey Babkin: "Re: Re: Handling of shell builtins in make(1)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 24 May 2005 12:46:33 +0200 (CEST) To: Peter Jeremy <PeterJeremy@optushome.com.au>
On Tue, 24 May 2005, Peter Jeremy wrote:
PJ>On Mon, 2005-May-23 20:50:40 -0600, Scott Long wrote:
PJ>>Harti Brandt wrote:
PJ>>>The result of this is that for one and the same command you can get
PJ>>>different behaviour whether you execute it via make(1) or via sh -c '...'.
PJ>
PJ>Not to mention the effect of IFS. Does POSIX provide any helpful
PJ>suggestions on how to efficiently implement the behaviour they specify?
POSIX has no .SHELL target - that's pmake's invention. IFS is no problem
because in order to specify a different IFS you need to have at least a
'=' on the command line. This is a meta character so the command will be
executed by the shell.
Generally POSIX says that make should execute command lines as if given to
system(). System() in turn says that it should behave as if it fork()ed
and execl()ed "sh -c ...". The as-if here seems to allow for our
optimisation.
PJ>
PJ>>4. Separate /bin/sh into a front end and back end (libsh) and include
PJ>>libsh into make.
PJ>
PJ>And this still won't help people who use .SHELL (or similar) to pick
PJ>a different shell.
PJ>
PJ>5) Add a "POSIX_ME_HARDER" option that just invokes the shell on every
PJ> command. In the absence of this option, make(1) is free to directly
PJ> exec the command if it's simple enough.
PJ>
PJ>6) Add two new magic line markers (to supplement '@', '+' and '-') to
PJ> require the line be executed using the shell or exec'd directly,
PJ> superceding the buildin rules.
You can alway make to execute the shell by putting a meta-character on the
command line or by specifying and empty builtin list or an empty meta
character list to .SHELL. But what should we do as default?
harti
_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
- Previous message: Peter Jeremy: "Re: Handling of shell builtins in make(1)"
- In reply to: Peter Jeremy: "Re: Handling of shell builtins in make(1)"
- Next in thread: Sergey Babkin: "Re: Re: Handling of shell builtins in make(1)"
- Maybe reply: Sergey Babkin: "Re: Re: Handling of shell builtins in make(1)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: Redirection issue
... 1- execute input commands from standard input, ... the phrase "it does not work
anymore" carries very little meaning. ... after compilation and execution of the shell
with a simple command like ... all the command in the file are executed as well. ...
(comp.lang.c) - Re: Redirection issue
... 1- execute input commands from standard input, ... the phrase "it does not work
anymore" carries very little meaning. ... after compilation and execution of the shell
with a simple command like ... all the command in the file are executed as well. ...
(comp.lang.c) - Re: shell scripting
... and am assuming an sh-compatible shell here.... ... command 1 options
arguments ... To run the script, do: ... then you need to use the full path to execute
it: ... (comp.unix.shell) - Re: shell scripting
... and am assuming an sh-compatible shell here.... ... command 1 options
arguments ... To run the script, do: ... then you need to use the full path to execute
it: ... (comp.unix.questions) - RE: DTS and stored procedure
... There is a command prompt utility "dtsrun". ... The DTS package can be
stored in the Microsoft® SQL Server™ ... Specify server_name to ... Displays the
encrypted command used to execute the DTS package without ... (microsoft.public.sqlserver.dts)