[Surfraw-devel] Surfraw-2.2.8 native sed on OSX may break things

Ian Beckwith ianb at erislabs.net
Mon Oct 10 02:53:27 UTC 2011


Sorry about the delay getting back to you.

On Fri, Sep 09, 2011 at 11:44:36PM +0000, Panther Martin wrote:
> Mac native sed is turkey fiddles (try to say that 10 times fast).
> So list_elvi() takes a pecking and misbehaves.
> If I replace sed with gsed in that function, it works.
> Sadly though, gsed is not native.  

Can you narrow down the problem further? If gsed isn't native, I'd
rather try and work round the problem, or maybe switch to awk.

I've tweaked the regex slightly in git master, it is now:

sed -n 's/^.*elvis:[ 	]+\(.*\)$/\1/p' $(find "$dir" ! -type d ! -type l ! -name '*~' | sort)

where $dir is /usr/lib/surfraw/elvi or wherever the elvi live on your system.
Note that the square brackets should contain a space and a tab.

Can you play round with it, see if you can narrow down the problem?

I would suspect the backreference \1 is the most likely culprit, or
maybe it doesn't like it if find doesn't return anything (as can
happen with the local elvi dir). Surely it supports -n?



Ian Beckwith - ianb at erislabs.net - http://erislabs.net/ianb/
GPG fingerprint: AF6C C0F1 1E74 424B BCD5  4814 40EC C154 A8BA C1EA
Listening to: Orb - Yasuaki Shimizu = Secret Squirrel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 237 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/surfraw-devel/attachments/20111010/4c794f17/attachment.pgp>

More information about the Surfraw-devel mailing list