On Sun, Dec 11, 2005 at 12:34:42PM +0100, Werner LEMBERG wrote:
> Consider this pipeline
> 
>   makeinfo --version | sed 's/^.* \([^ ]\+\)$/\1/;1q'
> 
> with GNU sed 4.0.9 I get
> 
>   4.8
> 
> but with the (BSD) sed from OS X I get
> 
>   makeinfo (GNU texinfo) 4.8
> 
> I wonder whether this is a BSD sed bug or whether I'm doing something
> wrong.

GNU sed recognizes `\+' as shorthand for `\{1,\}', but POSIX leaves its meaning
undefined.  I suspect BSD sed treats it like literal `+'.

Consider using this:

  makeinfo --version | sed 's/.* //;q'

Please accept my apologies for the delay in responding to your query.


Reply via email to