Bash: functions and arguments

A function is easily defined in a script as somename() { echo "blar" } which you then call via somename.

You can pass parameters like somename "hi there" and with the definition somename() { echo ${1}!! }.

bash

Edit on github
comments powered by Disqus
Click me