bash script function parameters

I have a question about bash script.

Can I create a function there that accept parameters like functions in program language?

Yes you don't actually put them in the functions header, but you can look at each parameter giving to a function the same way you look at shell parameters. The parameters start with $1, $2... and so on.

1 Like

Yes, call by value. And you can emulate call by reference, but usually you do not need that and just capture the output of the function..

1 Like