Best Answer · By JanBask DevOps Expert
Answered on Feb 2, 2020
Many times it becomes necessary to pass arguments in functions. These arguments can be taken from the user during runtime or can be passed on via environment variables etc.
Syntax -
$ function_name $arg1 $arg2
Example -
mytestfunc()
{
c = $1+$2
}
To return values within function.
function_name()
{
echo “testing return”
return 1
}
Was this helpful?