Re: grep 2.7 & linked-images
Re: grep 2.7 & linked-images
- Subject: Re: grep 2.7 & linked-images
- From: Axel Luttgens <email@hidden>
- Date: Sun, 2 Jan 2011 13:15:55 +0100
Le 2 janv. 2011 à 11:27, Christopher Stone a écrit :
> Hey Folks,
>
> This morning I got irked enough by the fact that 10.6.5's grep's 'ignore-case' flag breaks when the 'only-matching' flag is used to go looking for a solution. The solution was MacPorts and the most recent version of 'grep' 2.7.
>
> The built-in in Snow Leopard is "grep (GNU grep) 2.5.1.
>
> With 2.7 this works properly:
>
> # Grab linked-images
> set yourURL to quoted form of "http://members.aceweb.com/randsautos/photogallery/ferrari/enzo/"
> set cmdStr to "curl -L --user-agent 'Opera/9.70 (Linux ppc64 ; U; en) Presto/2.2.1' " & yourURL & " | /opt/local/bin/egrep --ignore-case --only-matching \"<a href[^>]+\\.jpg[^>]*>\""
> do shell script cmdStr
Hello Chris,
Quickly tested grep (egrep) here and, yes, options -i and -o don't gracefully co-exist. Thanks for having taken the time to report that one.
Of course, against precise cases, one could code for case-insensitivity, as in:
[...] /usr/bin/grep --only-matching '<[aA] [hH][rR][eE][fF][^>]+\\.[jJ][pP][gG][^>]*>'"
but this doesn't make the bug disappear...
Have you submitted a bug report?
Axel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden