請問如何在perl 給user 檔案選單設定或是加總當日Total Counts
譬如說在 shell script 中是
##### choosing which file type #################
echo "Please Choose Solution ?"
echo " 1) Please Input An filename ?"
echo " 2) Summation Daily Total Counts"
read ftype
if [ "$ftype" == "1" ]
then
echo "Please input filename and file path"
read filepath
if [ ! -e "$filepath" ]
then
echo "************************************"
echo "*****Shit!! File does not exist****"
echo "************************************"
exit
fi
for i in $datatype
do
gzcat $filepath |grep $i >> $tmp_folder/$i.log
done
proc_pm;
elif [ $ftype == "2" ]
then
echo " Please input date for processing "
read filedate
ch_server;
echo "Please input path "
read datepath
datefile=`ls -al $datepath/PM.$hostip.$filedate.*.xml.gz | wc -l`
if [ "$datefile" == "0" ]
then
echo "Sorry !! There are no PM files under $datepath"
exit 1
fi
for i in $datatype
do
gzcat $datepath/PM.$hostip.$filedate.*.xml.gz |grep $i >> $tmp_folder/$i.log
done
proc_pm;
else
echo "Sorry!! You don't give me the right command"
fi