[GRASS-user] grass prompt -- strange behaviour

Glynn Clements glynn at gclements.plus.com
Mon May 15 04:16:35 EDT 2006


Martin Landa wrote:

> there is something strange with GRASS prompt on my computer (Debian
> GNU/Linux unstable, UTF8). An example script:
> 
> for map in $(ls *.xml); do echo "$map -> ${map%%.xml}"; done

Why the "ls", rarther than just:

	for map in *.xml ; do ...

?

> GRASS not running
> 
> $ for ...
> 
> abscl-seidl.gkf.xml -> abscl-seidl.gkf
> abscl-temelin.gkf.xml -> abscl-temelin.gkf
> bug-1.3.25-zpk.gkf.xml -> bug-1.3.25-zpk.gkf
> ...
> zoltan-test_2d_gon.gkf.xml -> zoltan-test_2d_gon.gkf
> zoltan-test_3d_dms.gkf.xml -> zoltan-test_3d_dms.gkf
> zoltan-test_3d_gon.gkf.xml -> zoltan-test_3d_gon.gkf
> 
> -> OK
> 
> GRASS running ...
> 
> GRASS > for ...
> 
> abscl-seidl.gkf.xml -> abscl-seidl.gkf.xml
> abscl-temelin.gkf.xml -> abscl-temelin.gkf.xml
> bug-1.3.25-zpk.gkf.xml -> bug-1.3.25-zpk.gkf.xml
> ...
> zoltan-test_2d_gon.gkf.xml -> zoltan-test_2d_gon.gkf.xml
> zoltan-test_3d_dms.gkf.xml -> zoltan-test_3d_dms.gkf.xml
> zoltan-test_3d_gon.gkf.xml -> zoltan-test_3d_gon.gkf.xml
>  ->
> 
> So, ${map%%.xml} does not work any more, overmore there is a strange
> last line containing empty variable $map.
> 
> Am I doing anything wrong? I am a little bit confused;-)

My first suspicion would be that the session startup is changing
either which "ls" command is used or the behaviour of the "ls"
command. Everything except for "ls" is a shell built-in.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-user mailing list