I am writing a script, where I need to work with parameters.
Here is my foo.sh:
say_hello()
{
if [ "$1" == "hello" ]
then
echo "hello"
else
echo "<$1>"
fi
}
echo "$1"
say_hello
The output looks very strange for me:
hello
<>
Could you explain me why in function I can`t work with params? And how I could pass script params in function?