All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <ebb9@byu.net>
To: Stephen Boyd <bebarino@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCHv2] am: fix patch format detection for Thunderbird "Save As" emails
Date: Fri, 18 Dec 2009 22:38:27 -0700	[thread overview]
Message-ID: <4B2C66D3.1070508@byu.net> (raw)
In-Reply-To: <4B2C395A.6080300@gmail.com>

According to Stephen Boyd on 12/18/2009 7:24 PM:
>> 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

Syntax error.  "$/" is not defined, so the argument to sed is not
portable.  Then, following the tr, you have an unquoted ;, meaning you
invoked 'tr "'"', followed by invoking the (non-existent) command '.

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

Closer, but not there yet.  "$/" is still not defined.  Then, as a matter
of style, '\' is more readable than "\\" for representing a backslash.  So
as long as we are shifting to '', we might as well do it everywhere in
that line - write it like this:

} | sed -e 's/$/;/' | tr ';' '\015' > patch1-crlf.eml

and you should be set.

-- 
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net

  reply	other threads:[~2009-12-19  5:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-17 23:58 [PATCH] am: fix patch format detection for Thunderbird "Save As" emails Stephen Boyd
2009-12-18  0:15 ` Junio C Hamano
2009-12-18 21:34   ` [PATCHv2] " Stephen Boyd
2009-12-18 21:42     ` Eric Blake
2009-12-18 21:59       ` Stephen Boyd
2009-12-18 22:42         ` Eric Blake
2009-12-19  2:24           ` Stephen Boyd
2009-12-19  5:38             ` Eric Blake [this message]
2009-12-19  6:21               ` Stephen Boyd
2009-12-19  7:07                 ` Stephen Boyd
2009-12-19  7:39                   ` Junio C Hamano
2009-12-19 11:49                     ` Stephen Boyd
2009-12-19 10:26                 ` Andreas Schwab
2009-12-18 23:49       ` Junio C Hamano
2010-01-05 22:38     ` Nanako Shiraishi
2010-01-21 18:51       ` Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B2C66D3.1070508@byu.net \
    --to=ebb9@byu.net \
    --cc=bebarino@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.