[GRASS-dev] [grass-code I][379] r.in.wms incorrect flag

code I item #379, was opened at 2007-04-24 19:03
Status: Open
Priority: 3
Submitted By: Agustin Diez Castillo (dieza)
Assigned to: Nobody (None)
Summary: r.in.wms incorrect flag
Issue type: module bug
Issue status: None
GRASS version: CVS HEAD
GRASS component: None
Operating system: MacOS X
Operating system version: 10.4.9
GRASS CVS checkout date, if applies (YYMMDD): 070422

Initial Comment:

WARNING: xml2 NOT avaliable
sed: sed: 1: "s/<Layer .*>/LAYER:/i
": bad flag in substitute command: 'i'
1: "s/<Name>\s*\(\w*\)/~\1~ ...": bad flag in substitute command: 'i'
sed: 1: "s/<\/Name>\n//ig
": bad flag in substitute command: 'i'sed: 1: "s/<\/Layer.*>//i
": bad flag in substitute command: 'i'

sed: 1: "s/<\/*.*\/*\/*>//i
": bad flag in substitute command: 'i'
sed: 1: "s/<\/Title>//i
": bad flag in substitute command: 'i'
sed: 1: "s/<Style>\n*\s*\(\w*\)/ ...": bad flag in substitute command: 'i'
sed: 1: "s/<Title>\(.*\)<\/Title ...": bad flag in substitute command: 'i'
sed: 1: "s/<\/Style>//i
": bad flag in substitute command: 'i'

The problem seems to be the alternative sed command used. That /i is not a valid flag to the s/ sed command.

----------------------------------------------------------------------

You can respond by visiting:
http://wald.intevation.org/tracker/?func=detail&atid=204&aid=379&group_id=21

http://wald.intevation.org/tracker/?func=detail&atid=204&aid=379&group_id=21
..

code I item #379, was opened at 2007-04-24 19:03
Summary: r.in.wms incorrect flag
Operating system: MacOS X
Operating system version: 10.4.9

..

WARNING: xml2 NOT avaliable
sed: sed: 1: "s/<Layer .*>/LAYER:/i
": bad flag in substitute command: 'i'
1: "s/<Name>\s*\(\w*\)/~\1~ ...": bad flag in substitute command: 'i'
sed: 1: "s/<\/Name>\n//ig
": bad flag in substitute command: 'i'sed: 1: "s/<\/Layer.*>//i
": bad flag in substitute command: 'i'

sed: 1: "s/<\/*.*\/*\/*>//i
": bad flag in substitute command: 'i'
sed: 1: "s/<\/Title>//i
": bad flag in substitute command: 'i'
sed: 1: "s/<Style>\n*\s*\(\w*\)/ ...": bad flag in substitute command:
'i' sed: 1: "s/<Title>\(.*\)<\/Title ...": bad flag in substitute
command: 'i' sed: 1: "s/<\/Style>//i
": bad flag in substitute command: 'i'

The problem seems to be the alternative sed command used. That /i is
not a valid flag to the s/ sed command.

from the Sed FAQ:
  http://sed.sourceforge.net/sedfaq3.html#s3.1.3

--quoted--
GNU sed 3.02 and ssed also offer the /I switch for doing
a case-insensitive match. For example,

     echo ONE TWO | gsed "s/one/unos/I" # prints
"unos TWO"
--endquote--

anyone know a regex solution that's more portable than s///i?

Hamish

If this is a BSD sed issue (which it seems to be, this being MacOSX),
the only portable thingie is:

s/[Ee][Vv][Ee][Rr][Yy]/possible capitalization as alternations/

As a MacOSX-only workaround, define SED="perl -pe" then call $SED
's/aa/AA/i' instead of sed 's/aa/AA/i', which works if:

1) Perl is installed (always true for MacOSX and linuxen)
2) A compatible subset of commands (e.g. simple s///i) is used in the sed code
3) The regexps don't use backreferences and capturing parenthesis
(which works differently in perl and sed)

BTW does BSD sed recognize \w?

OTOH, given that in r.in.wms the /i flags are used after a grep which
IS case-sensitive, they can be removed, AFAICT. Can anybody try this?

Daniel.

On 4/25/07, Hamish <hamish_nospam@yahoo.com> wrote:

http://wald.intevation.org/tracker/?func=detail&atid=204&aid=379&group_id=21
..
> code I item #379, was opened at 2007-04-24 19:03
> Summary: r.in.wms incorrect flag
> Operating system: MacOS X
> Operating system version: 10.4.9
..

> WARNING: xml2 NOT avaliable
> sed: sed: 1: "s/<Layer .*>/LAYER:/i
> ": bad flag in substitute command: 'i'
> 1: "s/<Name>\s*\(\w*\)/~\1~ ...": bad flag in substitute command: 'i'
> sed: 1: "s/<\/Name>\n//ig
> ": bad flag in substitute command: 'i'sed: 1: "s/<\/Layer.*>//i
> ": bad flag in substitute command: 'i'
>
> sed: 1: "s/<\/*.*\/*\/*>//i
> ": bad flag in substitute command: 'i'
> sed: 1: "s/<\/Title>//i
> ": bad flag in substitute command: 'i'
> sed: 1: "s/<Style>\n*\s*\(\w*\)/ ...": bad flag in substitute command:
> 'i' sed: 1: "s/<Title>\(.*\)<\/Title ...": bad flag in substitute
> command: 'i' sed: 1: "s/<\/Style>//i
> ": bad flag in substitute command: 'i'
>
> The problem seems to be the alternative sed command used. That /i is
> not a valid flag to the s/ sed command.

from the Sed FAQ:
  http://sed.sourceforge.net/sedfaq3.html#s3.1.3

--quoted--
GNU sed 3.02 and ssed also offer the /I switch for doing
a case-insensitive match. For example,

     echo ONE TWO | gsed "s/one/unos/I" # prints
"unos TWO"
--endquote--

anyone know a regex solution that's more portable than s///i?

Hamish

_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

--
-- Daniel Calvelo Aros