bash - Shell script assign variable value to another new variable -


i need small correction below code. trying assign variable value variable, it's not working. please me.

below script.

#!/bin/sh choice=1 val1="test" if [ "$choice" == 1 ];    echo "insode"    echo $choice    purpose=$val1    echo "*"    echo $purpose fi 

please me, i'm new shell scripting. need display purpose value test.

you assign value val1:

val1="test" 

but later assign $val1 purpose:

purpose=$val1 

you have fix case variable names match (fix lowercase l uppercase l).


Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -