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

Hamish hamish_b at yahoo.com
Wed Nov 19 05:12:47 EST 2008


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



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


Hamish



      



More information about the grass-dev mailing list