I am viewing a ksh script and I see a function where the variable has been defined as below. Can anyone explain what exactly the below assignment of variable means in ksh script?temprule=\$${APPLC_NM}
Variable assignment in a ksh script
ksh;variable
As @Julie Pelletier indicated, this is funny syntax to make a indirect variable, or a nameref. ksh has some specialized syntax to make this work, however. This is a feature of ksh, and might not work in other shells.The more idiomatic way to write the same in ksh would look like this:# Set up the nameref:nameref temprule=APPLC_NM# Assign value to AAPLC_NMAPPLC_NM=abc# The above two statements may be executed in any order.# Now, temprule will contain the value of APPLC_NM:echo $tempruleabcNow, no funny escaping of double $ is necessary, and the result is arguably more readable. 