Re: [PATCH] rebase--interactive: Replace unportable 'tac' by a sed script.
- From
Andreas Ericsson <ae@op5.se>
- Date
- Apr 28, 2008, 09:11 UTC
- Message-ID
- <481594B3.4020608@op5.se>
- In-Reply-To
- <20080428090417.GB16153@sigill.intra.peff.net>
Jeff King wrote:
Show 8 quoted lines
> On Mon, Apr 28, 2008 at 09:44:48AM +0200, Johannes Sixt wrote: > >>> + perl -e 'print reverse <>' | \ >> [...] >> + sed -ne '1!G;$p;h' | \ > > Wow, and people complain about perl being unreadable. ;) >
Well, the tmtowtdi dogma has its drawbacks. Here's another sed-script that does the exact same thing:
sed '1!G;h;$!d'
That being said, perl borrows most of its regex notation from sed, so it's not as if perl is easier. This is just the top-end of the scale that things like "sed s/foo/bar/" is at the bottom of ;-)
-- Andreas Ericsson andreas.ericsson@op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231