#!/bin/bash ARGS=1 COUNT=0 b_CAT=/bin/cat b_WC=/bin/wc if [ $# -lt "${ARGS}" ] then echo "Usage: mlmmj-list [-n] " exit 1 fi if [ $1 = "-n" ]; then COUNT=1 PATH=${2%/} else PATH=${1%/} fi if [ ! -d "${PATH}" ] || [ ! -r "${PATH}" ]; then echo "${PATH} is not a directory or is not readable" exit 1 fi if [ ${COUNT} -eq 1 ]; then ${b_CAT} ${PATH}/subscribers.d/* | ${b_WC} -l else ${b_CAT} ${PATH}/subscribers.d/* fi