Re: [PATCH 1/1] Makefile: fix the "built from commit" code

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

 



Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes:

>> I.e.:
>> 
>>   FOO='with spaces'
>>   BAR=$FOO sh -c 'echo $BAR'
>> 
>> works just fine.
>
> 	$ x="two  spaces"
>
> 	$ echo $x
> 	two spaces
>
> Maybe we should quote a little bit more religiously.

Both of you are wrong ;-)

Of course, the lack of dq around echo's argument makes shell split
two and spaces into two args and feed them separately to echo, and
causes echo to show them with a single SP in between.  Peff's
exampel should have been

	BAR=$FOO sh -c 'echo "$BAR"'

But that does not have much to do with the primary point Peff was
talking about, which is that in this sequence:

	$ x="two  spaces"
	$ y="$x"
	$ z=$x
	$ echo "x=<$x>" "y=<$y>" "z=<$z>"

assignment to y and z behave identically, i.e. dq around "$x" when
assigning to y is not needed.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux