identifying what's running ( was Re: [Novalug] "10 Linux commands you've never used" article)

Russell Evans russell-evans@qwest.net
Thu Feb 22 17:33:10 EST 2007


On Thu, 22 Feb 2007 15:09:47 -0500
"donjr" <djr1952@hotpop.com> wrote:


> #!/bin/sh
> #
> for PREPROCESS in $(ps -e|awk '{print $4}'|sort -u)
> do
>   PROCESS=${PREPROCESS//\/0}
>   MAN=$(man -f ${PROCESS}) 
>   TEST_MAN=${MAN//nothing appropriate}
>   if [ "${#MAN}" = "${#TEST_MAN}" ]; then
>     echo ${MAN}
>     echo
>   fi
> done | less
> 
> I used 'sort -u' (or sort --unique) to replace the "${PROCESS}" !=
> "${LAST}" related parts of the script.
> 

Much better as the check for last is pretty lame and only worked a
little. 

Thank you
Russell





More information about the Novalug mailing list