Hi R Rao here is the script
################test.sh##############
###Use: ./test.sh -m 04 -y 06 -p iXOS########
##################################
while getopts m:y
: argmnt ####please use m colon y colon p colon
do
case $argmnt in
m) aflag=1
month="$OPTARG";;
y) bflag=1
year="$OPTARG";;
p) cflag=1
filter="$OPTARG";;
*) echo "Invalid argumetn passed.."
exit 99;;
esac
done
if [[ -z $aflag ]]
then
echo "month missing..Use: -m month -y year -p filter"
exit 1
fi
if [[ -z $bflag ]]
then
echo "year missing..Use: -m month -y year -p filter"
exit 2
fi
if [[ -z $cflag ]]
then
echo "Filter missing..Use: -m month -y year -p filter"
exit 3
fi
grep -h "$filter" NB_success* | grep "$month/$year"