#! /bin/ksh

#
# Name        : ${HOME}/bin/listHttpd.ksh
#
# Version     : 1.0
#
# Author      : Gerard van Wageningen
#
# Description : List Apache http.conf files on a system 
#
# 1.0   First Version
#

\whence set_debug 1>/dev/null 2>&1 && eval $( set_debug ${0##*/} )

typeset old_IFS="${IFS}"
typeset -i i

ps auxwwwww \
| grep -v grep \
| grep httpd \
| while read LINE
  do
    IFS=' '
    set -A FIELDS ${LINE}
    IFS="${old_IFS}"

    i=0
    while (( i < ${#FIELDS[*]} ))
    do
      if [[ "${FIELDS[i]}" = '-f' ]]
       then
        print -- "${FIELDS[i+1]}"
      fi
      i=i+1
    done
  done \
  | sort -u

exit 0

################# EOF #################
