#!/usr/bin/sh
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# bos720 src/bos/usr/bin/cdat/smit/cdat_list_sched_coll.sh 1.2 
#  
# Licensed Materials - Property of IBM 
#  
# COPYRIGHT International Business Machines Corp. 2010,2011 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 
# @(#)37    1.2  src/bos/usr/bin/cdat/smit/cdat_list_sched_coll.sh, cdat, bos720 7/15/11 04:48:55
# This command returns the list of scheduled collects recorded in the cdat 
# user cron file
#

PATH=/bin:/sbin:/usr/bin:/usr/sbin

[ $# -ne 0 ] && \
	echo "Usage: $0" && exit 1

MUSER=`/usr/lib/cdat/smit/cdat_init_values | sed -n 2p \
	| sed -ne 's/:.*$//p'`
# crontab: call crontab to get scheduled collect
# grep: suppress comment line
# sed: change <tab< in space
# sed: select line including /usr/bin/cdat collect
# awk: print collect name and type
crontab -l $MUSER | grep -v "^#" | sed -e 's/	/ /' | \
	sed -n -e 's:.*/usr/bin/cdat  *collect  *::p' | \
	awk '
	{
		system( "/usr/lib/cdat/smit/cdat_print_sched_coll " $0)
	}'
exit 0
