#/bin/bash #for init_process in `ls -l /etc/runlevels/default/|grep total -v|awk '{print $9}'` for init_process in /etc/runlevels/default/* do echo echo "process:$init_process" #sudo /etc/init.d/`basename $init_process` status |awk '{printf "process %s\n",$init_process}' sudo /etc/init.d/`basename $init_process` status done