The above question fits to be a generic automation question, like how to repeat task T over several maps M?.
If you do work on Linux (with a bash-shell beforehand), you can utilise bash shell command line utilities (read also Shell Commands). Among the most frequently used is the for
loop(ing construct). A simple example could be (where MAP is a variable which "contains" in each loop one of the requested maps *MAP_A*, *MAP_B*, *MAP_C*):
for MAP in MAP_A MAP_B MAP_C ; do r.mapcalc "${MAP}"_subset = "${MAP}" ; done
The above command will execute r.mapcalc "${MAP}"_subset = "${MAP}"
over the 3 maps MAP_A, MAP_B, MAP_C.
Of course one can feed the loop with as many maps -- let them be vector or raster -- as asked! Another example, within GRASS-GIS' environment, could be using the results of a g.list
command to feed the $MAP
variable (given there are raster maps named with the prefix "landsat_"):
for MAP in `g.list rast=landsat*` ; do r.mapcalc "${MAP}"_subset = "${MAP}" ; done
The above command will repeat the same as above command over all maps whose name begins with the prefix landsat_.
An on-going effort to enrich the respective GRASS-GIS wikipage with simple examples is located at GRASS and Shell