DV> ls -ltr
total 48
-rwxr-xr-x 1 pb5377 it-ibm 145 Mar 16 17:50 test_upd.sh
-rwxr-xr-x 1 pb5377 it-ibm 144 Mar 16 19:11 test1.sh
-rwxr-xr-x 1 pb5377 it-ibm 156 Mar 16 19:37 test.sh DV> ./test.sh
ksh: ./test.sh: not found DV>
If at all if the script gets executed, it is not recognizing the function and the commands in the script get executed sequentially.
The output looks like
DV> ./test.sh
/usr/bin:/sbin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/ucb:/usr/local/bin:/usr/local/sbin:/usr/sfw/bin:/opt/VRTS/bin:/usr/local/bin:/usr/local/sbin:/usr/ccs/bin
./test.sh[5]: performbuild: not found
Inside performBuild function
Main Shell started
./test.sh[11]: performbuild: not found
Main Shell ended DV>
/home/thillaiselvan:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:.:/home/thillaiselvan/.vim/ctags-5.7/
Main Shell started
Inside performBuild function
Main Shell ended
Thanks Tyler_Durden for your reply. I got it worked now. The problem is that some funky/control characters were came in with the file and they were causing the problem initially.