#!/bin/bash
#########################################################
# 							#
# This is BashStyle-NG  				#
#							#
# Licensed under GNU GENERAL PUBLIC LICENSE v3    	#
#							#
# Copyright 2007 - 2013 Christopher Bratusek		#
#							#
#########################################################

case $1 in
	*help )
		echo -e "\n${ewhite}Usage:"
		echo -e "\n${eorange}count_processes${ewhite} | ${egreen}! no options !\n"
		tput sgr0
	;;

	* )
		procs=$(ps ax | wc -l | awk '{print $1}')

		if [[ $procs -lt 10 ]]; then
			echo "000$procs"
		elif [[ $procs -lt 100 ]]; then
			echo "00$procs"
		elif [[ $procs -lt 1000 ]]; then
			echo "0$procs"
		fi
	;;
esac
