How to Call a Function

Hi

I have created a function in a Shell Script test.sh
function fnTest()
  {
        echo "My first Method
  }
   I have called this function in my test.sh
cat abc.txt | grep "test"
echo " test"
fnTest

But while running the shell script i got the following error:

./test.sh: line 5: fnTest: command not found

I have called the function in the same shell script.

Whether i have to do any configuration for accessing the function

Please Suggest me

Regards,
Nanthagopal

Place functions above the calls.

Try something like this...

function fnTest()
  {
        echo "My first Method"
  }

fnTest