I have written simple bash code to check the working of bash function , I found few code on internet showing similar examples like this, but as I did by own I am unable to retrieve the args value inside my function.
#!/bin/bash
function function_name() {
echo "inside function"
echo "$arg1"
}
var="muddassir"
function_name $var
This is the output I am getting while executing this script
$ ./test.sh
inside function