#!/bin/sh

# usage: forallve <command string>

if [ $# -lt 1 ] ; then
	name=`basename $0`
        echo Usage: $name [command to execute in each ve]
        echo "       to run complex command do something like:"
        echo "       $name \"netstat -tn \| tail +3\""
        exit 1
fi

export tmpE=$*

gawk -- ' $1 != 0 { \
  system(sprintf("vecmd %i %s",$1,ENVIRON["tmpE"]))i \
}' < /proc/veinfo
