The above code gives following error
./dbbackup.sh: line 6: : : command not found
./dbbackup.sh: line 6: : : command not found
Basically the assignment of variable " subject="$taskName" ": " $* " at `date` " " causes the error because of using the $taskName in it. Because when i remove $taskName from it it gives no error. But this kind of assignment works outside the function.
I am relatively new to functions in shell and any help is appreciated.
Thanks
-Nitiraj
@sanoop etc.
The original problem was that ":" (colon) is a Shell command and it was trying to execute ": " (colon with an argument of a space character).