Re: [GUILT PATCH 2/5] guilt-guard: Assign guards to patches in series

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

 



"Thomas Adam" <thomas.adam22@xxxxxxxxx> writes:

> On 09/08/07, David Kastrup <dak@xxxxxxx> wrote:
>>     sed -i -e "s,^\($p[[:space:]]*.*\)\$,\1 #$x," "$series"
>>
>> and that's fine.
>
> I'm surprised to see 'sed -i' being at all, it's certainly non-portable.

Yes.  Neither is [[:space:]].  The above actually is pretty much
equivalent to

      $(RM) "$series+"
      sed "/^$p/s/\$/ #$x/" "$series" >"$series+"
      $(MV) "$series+" "$series"

Which is probably not what was intended (the whole [[:space:]]
construct is irrelevant).  More likely it was intended to do something
like

      $(RM) "$series+"
      sed "/^$p[ 	]/s/\$/ #$x/" "$series" >"$series+"
      $(MV) "$series+" "$series"

or if $p can contain slashes but not commata,

      $(RM) "$series+"
      sed "\,^$p[ 	],s,\$, #$x," "$series" >"$series+"
      $(MV) "$series+" "$series"

Note that the included tab character will get safely from any shell to
any sed.

-- 
David Kastrup

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

  Powered by Linux