generic script to pool a command on multiple samples.