asu () { user=$1; shift; su $user -c “$*”; }
Category Archives: bash
execute multiple commands on multiple servers from the shell command line
for i in host{1,2,3}.{east,west}.serverdomain.net;do ssh -t $i ‘for i in this that;do ls $i;done’;done
bash hello open tcp ports
bash -c 'for n in $(seq 1 1024);do (echo </dev/tcp/localhost/$n) &</dev/null && echo $n open;done'
bash one liners start with -c
bash -c 'i=("hellO" "WOrld");i=${i/h/H};echo ${i[*]/O/o}\!'