help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: whitespace


From: ali hagigat
Subject: Re: whitespace
Date: Tue, 14 Dec 2010 08:22:03 +0330

Dear Paul Smith,
Thank you very much for your valuable comments.
Please look at the following example, its output and the extract of
the documentation:
----------------------------------------
var1='rrrr\
        ffff'
var2='rrrr     ffff'
all:
        @echo $(var1)
        @echo $(var2)
        @echo 'rrrr\
           ffff'

The output:
rrrr ffff
rrrr     ffff
rrrr\
           ffff

----------------------------------------
5.1.1 Splitting Recipe Lines
In this situation the newline quoting rules for makefiles will be
used, and the backslash-newline will be removed.
----------------------------------------
make not only removes backslash-newline for echo $(var1)
but also white spaces!
Regards


On Sun, Dec 12, 2010 at 9:02 PM, Paul Smith <address@hidden> wrote:
> On Sun, 2010-12-12 at 17:01 +0330, ali hagigat wrote:

> The shell will parse your command line and break it up on whitespace
> boundaries, so all "internal" whitespace is removed.  If you run:
>
>        echo foo               bar
>
> then what gets printed?  "foo bar".  Because the shell breaks that
> command up and runs the echo command with the arguments "foo" and "bar",
> so that's what echo prints.  If you want to preserve whitespace you must
> use quotes.
>
> --



reply via email to

[Prev in Thread] Current Thread [Next in Thread]