#!/bin/bash
if [ "$#" = 0 ]; then exit 1; fi
#COLUMNS=1000 ps -e --no-heading | grep -i "$@" | grep -v grep | sed 's/^ *//; s/ .*//' | fail0
COLUMNS=1000 ps --no-heading -eo "pid args" |
  sed 's/^ *//; s/\( [^ ]* \).*/\1/;' |
  grep -i "$@" | grep -v grep |
  sed 's/ .*//' | fail0
# FIXME this might not work with perl scripts etc
