[GRASS-dev] g.mlist: exclude parameter wish

Markus Neteler neteler at osgeo.org
Wed Nov 19 06:40:52 EST 2008


On Wed, Nov 19, 2008 at 11:12 AM, Hamish <hamish_b at yahoo.com> wrote:
> Markus wrote:
>> g.mlist type=rast patt="gpcp_1dd_p1d_*_count"
>> exclude="month"
>> gpcp_1dd_p1d_1997_count
>> gpcp_1dd_p1d_1998_count
>> gpcp_1dd_p1d_1999_count
>> gpcp_1dd_p1d_2000_count
>> gpcp_1dd_p1d_2001_count
>> gpcp_1dd_p1d_2002_count
>> gpcp_1dd_p1d_2003_count
>> gpcp_1dd_p1d_2004_count
>> gpcp_1dd_p1d_2005_count
>> gpcp_1dd_p1d_2006_count
>> gpcp_1dd_p1d_2007_count
>>
>> I know that -r and -e are available but I failed to write
>> an exclusion regex.
>> And often just simple patterns are to be suppressed in the
>> selection.
>
>
> no idea about the C version, but with the shell script version it would
> be roughly like
>
> if [ -n "$GIS_OPT_EXCLUDE" ] ; then
>  EXCLD_STR="| grep -v $GIS_OPT_EXCLUDE"
> else
>  EXCLD_STR=""
> fi
>
>
> g.list * ... | ... $EXCLD_STR

Yes - but I dunno how to implement that in C.

> do you now use g.mlist | grep -v 'expr' ?


g.mlist type=rast patt="gpcp_1dd_p1d_*_count"  | grep -v month | tr
'\n' ',' | sed 's+,$++g

but that's rather funky for daily usage.
[for today, Paul's trick helped but the problem will return]

Markus


More information about the grass-dev mailing list