Value of a Variable in Shell Script based on the condition mentioned in the IF statement.
I have a shell script, I want to assign a variable based on the condition in if
statement.
For Eg:
build(){
SRC_TBL=$1
filename=`echo $SRC_TBL | sed 's/_//g'`
target_tbl=`echo $SRC_TBL | tr '[a-z]' '[A-Z]'`
if [["${target_tbl}" == "DEMO" ]];then
target_tbl= "TEST"
fi
}
build "DEMO"
I am running the above function, so according to the logic the value of the variable target_tbl should be TEST, but it is still DEMO.
Help me where am I going wrong