From: Stephen Boyd Date: Sat, 19 Dec 2009 02:24:26 GMT Subject: Re: [PATCHv2] am: fix patch format detection for Thunderbird "Save As" emails Message-ID: <4B2C395A.6080300@gmail.com> In-Reply-To: On 12/18/2009 02:42 PM, Eric Blake wrote: > Stephen Boyd gmail.com> writes: >>> echo and \ do not portably mix. For that matter, shell double quotes and >>> backslash escapes that are not required by POSIX do not portably mix. >> >> Thanks. Hopefully squashing this in will make it even more portable? >> >> + printf "X-Fake-Field: Line One\015\n"&& > > Nope. You need either "\\015\\n" or '\015\n', since "\015" and "\n" are both > undefined in portable shell. So, how about this? { echo "X-Fake-Field: Line One"&& echo "X-Fake-Field: Line Two"&& echo "X-Fake-Field: Line Three"&& git format-patch --stdout first | sed -e "1d" } | sed -e "s/$/;/" | tr "'";"'" "'"\015"'"> patch1-crlf.eml Or maybe this? { echo "X-Fake-Field: Line One"&& echo "X-Fake-Field: Line Two"&& echo "X-Fake-Field: Line Three"&& git format-patch --stdout first | sed -e "1d" } | sed -e "s/$/;/" | tr ";" "\\015"> patch1-crlf.eml