I wrote a bash function to export an environment variable. First function argument is a variable name, second is a variable value. I want to echo it to show what value was exported:
#!/bin/bash
env_var_export()
{
export $1=$2
echo ""
echo " export $1=$$1"
echo ""
}
env_var_export var defaultVal456
I mean, echo should print: export var=defaultVal456. Any help? I know I can do this:
echo ""
echo " export $1=$2"
echo ""
but its not the solution to my problem.