Re: What's cooking in git.git (Aug 2009, #03; Thu, 20)

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

 



Jakub Narebski <jnareb@xxxxxxxxx> writes:

>> +cat >>gitweb_config.perl <<EOF
>> +
>> +\$feature{'snapshot'}{'override'} = 0;
>> +EOF
>
> A trick: use '\EOF' and you don't need to escape $ against variable
> expansion by shell.
>
>   +cat >>gitweb_config.perl <<\EOF
>   +
>   +$feature{'snapshot'}{'override'} = 0;
>   +EOF

It is not a "trick" but is a basic courtesy for reviewers.  Even if you do
not have any $ to worry about, _unless_ you actively know you would want
variable substitution to happen, it is easier for readers if you signal
the fact that the here-doc is verbatim by quoting the \EOF marker upfront.

Same thing for use of single quotes vs double quotes when writing strings,
even though they tend to be small and much less of an issue.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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]