logo       

Re: newline escape problem.: msg#00021

Subject: Re: newline escape problem.
%% David Boyce <dsb@xxxxxxxxxx> writes:

  >> According to POSIX, setting the SHELL make variable has _NO_ effect on
  >> make's processing.  The POSIX definition of make requires that all
  >> commands be invoked "as if" passed directly to the system() function,
  >> and there is no way to specify that the system() function would use a
  >> different shell than the standard sh, of course.

  >> The standard handles SHELL specially such that it doesn't inherit that
  >> value from the environment nor put any make value for that variable back
  >> into the environment of subcommands, but neither does it provide for
  >> make to use the command provided by $(SHELL) rather than system() (or
  >> sh).

  db> Could you cite the relevant C&V please? I don't have access to
  db> POSIX.1 (unless it's become freely available since I last looked?)
  db> but SUSv3 says only this:

  db>       The SHELL macro shall be treated specially. It shall be provided by
  db>       make and set to the pathname of the shell command language
  db>       interpreter (see sh ). The SHELL environment variable shall not
  db>       affect the value of the SHELL macro. If SHELL is defined in the
  db>       makefile or is specified on the command line, it shall replace the
  db>       original value of the SHELL macro, but shall not affect the SHELL
  db>       environment variable. *Other effects of defining SHELL in the
  db>       makefile or on the command line are implementation-defined.*

  db> (emphasis mine). Does POSIX flatly contradict this? Surprising if
  db> true. And are you looking at a new or relatively old rev of POSIX?

No, this is what I mean.

I guess I wasn't quite clear above: I didn't mean that POSIX disallowed
what GNU make (and other makes) do with the SHELL variable.

I only meant that POSIX doesn't _require_ that setting SHELL would change
the way commands were invoked.

And in fact, elsewhere in the make standard it says explicitly:

  Command execution shall be as if the makefile command line were the
  argument to the system() function.

I suppose you could still do something like this:

  system("$(SHELL) -c <command>");

and be conforming :).

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@xxxxxxx>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qnx.openqnx.dev...    politics.lenini...    audio.emagic.ex...    tex.texinfo.gen...    handhelds.linux...    ietf.sipping/20...    lang.erlang.gen...    cygwin.talk/200...    yellowdog.gener...    mozilla.devel.l...    xfree86.newbie/...    openbsd.ports/2...    db.oracle.devel...    kde.kalyxo.deve...    user-groups.lin...    bbc.cvs/2003-04...    gnu.libtool.bug...    redhat.k12osn/2...    emulators.wine....    freebsd.devel.d...    search.xapian.g...    java.izpack.use...    network.mrtg.us...    windows.total-c...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe