#!/bin/bash

#if ("$1" == "pids") then
#  /bin/ps -A | sed 1d | awk '{print $1}'
#else if ("$1" == "names") then
#  /bin/ps -A | sed 1d | awk '{print $4}' | sed "/ps/d;/psctl/d"
#else
#  echo "usage: psctl [pids|names]"
#endif

( echo "Pid Status Command"
  for i in `(find /proc -name stat 2> /dev/null) | sed 1d`; do
    ( cat $i | awk '{print $1" "$3" "$2}' ) 2> /dev/null
  done ) | column -t

