[PATCH] do not use sed for version date processing but rather simpler cut

Matthias Kilian kili at outback.escape.de
Mon Apr 18 08:13:56 CEST 2011


On Sun, Apr 17, 2011 at 11:44:33PM +0200, Karel Gardas wrote:
> This patch fixes issue with version date processing on Solaris while using
> Solaris' provided sed. I don't know sed enough to remove GNUism in version
> date processing so I replaced sed usage in this task by few cut calls.

Out of curiosity: what's the result of the original command on Solaris?

	git log -n 1 --date=short --pretty=format:%ci | sed "s/^.*\([0-9][0-9][0-9][0-9]\)-\([0-9][0-9]\)-\([0-9][0-9]\).*$/\1\2\3/"

is ugly, but it *should* work.

Apart from this, a much simpler version (using cut, inspired by
your diff, but also tr) may be:

	git log -n 1 --date=short --pretty=format:%ci | cut -d ' ' -f 1 | tr -d -

Does this work on Solaris?

Ciao,
	Kili



More information about the Cvs-ghc mailing list