Hi,
I am new to shell script. I want to count to Delimiter count for my source file. For that I have written script. When I tried to execute the script I could not able to view the results. It throws errors. I don't know what the problem is. My aim is I want to store the delimiter count in one file.
#-------------------------------------------------------------------------------------------------------
# Name : Delimiter_Count_Check
# Usage : Delimiter_Count_Check
# Description : This process is used to check the delimiter count in source files
#-------------------------------------------------------------------------------------------------------
function Delimiter_Count_Check
{
Src_FileName=mgmtfile_cntl_20101201.txt
parameter=/opt/Files/${Src_FileName}_Delimitercount.txt
#Delimiter Count
Delimiter_Count=awk '{print $0, NR "|"}' $Src_FileName > $parameter
echo "delimiter count is $Delimiter_Count"
if [ $? -ne 0 ]
then
echo "ERROR : Problem in Delimiter check source file $Src_FileName"
else
echo "Delimiter count for source file is $Delimiter_Count"
fi
}
#call function
function call
{
if [ -f Delimiter_Count_Check]
then
Delimiter_Count_Check
fi
}