On Tue, 2010-12-28 at 22:24 -0800, Philip Guenther wrote: > On Tue, Dec 28, 2010 at 9:59 PM, ali hagigat <hagigat...@gmail.com> wrote:
> However, some other so-called "scripting" languages do treat newline > uniquely, such that there a scripts you cannot write without using > literal newlines. For example, that's true of csh. Without > .ONESHELL, you cannot write those scripts as recipes. With .ONESHELL, > you can. Actually, .ONESHELL is also useful for those programming languages which do NOT require or allow backslashes before newlines, for example Perl. In languages like this you MUST write your entire script in one physical line, rather than using multiple physical lines combined with backslash/newline pairs into logical lines. .ONESHELL solves this problem. And there are other advantages to running the entire script in a single shell, including some performance advantages (which can be somewhat mitigated, in most cases, by careful script writing) and other more esoteric advantages. > So, .ONESHELL may be more useful or interesting to someone who is > interested in setting SHELL=/bin/csh or similar. Setting SHELL=/bin/csh is NEVER a good idea. csh is quite simply totally unsuited to be used as the value of SHELL, at least with GNU make. For one thing, it does some very dodgy things with open file descriptors which utterly destroys the ability to use the parallel jobserver capability of GNU make. > > Another question is weather i can use newline after each command for > > /bin/sh? > > In make 3.81, it must see <tab> character at the beginning of each > > line or it complains. In addition to Philip's reply note that .ONESHELL is introduced in GNU make 3.82, to be clear. -- ------------------------------------------------------------------------------- Paul D. Smith <psm...@gnu.org> Find some GNU make tips at: http://www.gnu.org http://make.mad-scientist.net "Please remain calm...I may be mad, but I am a professional." --Mad Scientist _______________________________________________ Help-make mailing list Help-make@gnu.org http://lists.gnu.org/mailman/listinfo/help-make