[GRASSLIST:7143] i.group output suitable for further processing?

Hi all,

I'm trying to write some scripts that will process all raster files that
are referenced in a group. What I want to do is simple 'for $IMAGE in
`i.group -l group=<group>`' bash scripting. However, the output of
i.group -l is not suitable for this kind of thing: too much bloat. What
I would like to have is only the raster names, and nothing more. Anyone
knows a simple solution? O should I try to hack i.group and add a -b
switch to generate output suitable for batch processing?

Cheers,
Vincent.

PS: example output of i.group -l:

GRASS 6.1.cvs (asianislands@D10_patched):~ > i.group -l
group=20010711_patched
group [20010711_patched] references the following cellfiles
-------------
20010711_1_patched in D10_patched 20010711_2_patched in D10_patched
20010711_3_patched in D10_patched 20010711_4_patched in D10_patched
-------------
GRASS 6.1.cvs (asianislands@D10_patched):~ >

I'm trying to write some scripts that will process all raster files that
are referenced in a group. What I want to do is simple 'for $IMAGE in
`i.group -l group=<group>`' bash scripting. However, the output of
i.group -l is not suitable for this kind of thing: too much bloat. What
I would like to have is only the raster names, and nothing more. Anyone
knows a simple solution? O should I try to hack i.group and add a -b
switch to generate output suitable for batch processing?

The group files are stored in a simple ascii file located in
$MAPSET/group/$GROUPNAME/REF

Then just cat and take the first column.

or automatically:

GROUP=groupname

REF_FILE="`g.findfile element=group file=$GROUP | grep '^file=' | cut -f2 -d"'"`/REF"

cat $REF_FILE | awk '{print $1}'

Hamish