I have the following code in shell
#!/bin/sh
function myfunc
{
$1=3
echo "myvar = $myvar"
}
myfunc myvar
expected result:
myvar = 3
so basically what the script must do is this.
I will be calling the function and give it an argument. I want to declare that argument INSIDE the function. In other words, I choose the name of the variable when I call the function.
But it doesn't work...