Markus Neteler wrote: > On Tue, Dec 16, 2008 at 3:33 PM, <svn_gr...@osgeo.org> wrote: > > Date: 2008-12-16 09:33:27 -0500 (Tue, 16 Dec 2008) > > New Revision: 34913 > > > > Modified: > > grass/branches/develbranch_6/general/g.gisenv/main.c > > Log: > > g.gisenv: -s/n flags added (merge from trunk) > ... > > + flag_s = G_define_flag(); > > + flag_s->key = 's'; > > + flag_s->description = _("Use shell syntax (for \"eval\")"); > > + > > + flag_n = G_define_flag(); > > + flag_n->key = 'n'; > > + flag_n->description = _("Don't use shell syntax"); > > + > > Is -n really needed?
Yes. > GRASS 6.4.svn (spearfish60): > g.gisenv > GISDBASE=/home/neteler/grassdata > LOCATION_NAME=spearfish60 > MAPSET=neteler > DEBUG=0 > GRASS_GUI=text > > GRASS 6.4.svn (spearfish60): > g.gisenv -s > GISDBASE='/home/neteler/grassdata'; > LOCATION_NAME='spearfish60'; > MAPSET='neteler'; > DEBUG='0'; > GRASS_GUI='text'; > > GRASS 6.4.svn (spearfish60): > g.gisenv -n > GISDBASE=/home/neteler/grassdata > LOCATION_NAME=spearfish60 > MAPSET=neteler > DEBUG=0 > GRASS_GUI=text > > Isn't -n superfluous? No. $ g.gisenv GISDBASE=/opt/grass-data LOCATION_NAME=spearfish57 MAPSET=glynn GRASS_GUI=text $ g.gisenv | cat GISDBASE='/opt/grass-data'; LOCATION_NAME='spearfish57'; MAPSET='glynn'; GRASS_GUI='text'; $ g.gisenv -n | cat GISDBASE=/opt/grass-data LOCATION_NAME=spearfish57 MAPSET=glynn GRASS_GUI=text With neither -s nor -n, the default is -n if stdout is a tty and -s otherwise (e.g. if stdout is a pipe). The -n switch is necessary if you're parsing the g.gisenv output within a script, and you want the "simple" format (i.e. if you're not using bash's "eval" for parsing). -- Glynn Clements <gl...@gclements.plus.com> _______________________________________________ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev