a few general questions...

Dear Christopher,

if I understand you right this time, all you want to do is assign weights
to the different categories present in your map and then let r.stats
calculate the respective proportions of each 'weight' in the map. This
can be achieved easily by doing a r.reclass on your original map, in
which you substitute the original categories with their weights. r.stats
on the 'weight-map' will give you the data you want, no UNIX shells
needed there... Anyway, I think it's not too hard writing such a script
that checks the contents of your output on missing values.

And please correct me if it is something else you want -
it's always hard to explain what you want from a system when you're a new
user in a way that makes sense to more experienced users.

Enjoy the sunshine today,

Philip Verhagen
--

      S t i c h t i n g R A A P

    Regionaal Archeologisch Archiverings Projekt

adress: Plantage Muidergracht 14
          1018 TV Amsterdam
           THE NETHERLANDS
phone: (31) 20 525 5835
fax: (31) 20 525 5834
e-mail: motte@xs4all.nl