#!/bin/zsh # We have to supress less and grep for the pattern to work accurately if [[ $1 == "" ]]; then ps ax | egrep -v '(grep|pslist|less)' | less elif [[ $2 == "" ]]; then ps ax | egrep -v '(grep|pslist|less)' | less -p $* else opts=$1 shift ps "ax$opts" | egrep -v '(grep|pslist|less)' | less -p $* fi