Are the following 2 lines completely equivalent? If not what’s the difference? I’ve seen plenty of shell scripts utilize number 1 and was just wondering what it gives you compared with number 2.
typeset TARGET="${XMS_HOME}/common/jxb/config/${RUNGROUP}.${ENV}.properties"TARGET="${XMS_HOME}/common/jxb/config/${RUNGROUP}.${ENV}.properties"
typesetwill create a local variable (one which doesn’t “leak”). This is useful in functions but I’ve also seen it being used at the top level of a shell script.will print
You can also use
typesetto create arrays and integers.[EDIT] Added
functionkeyword because some shells require it. Remove it if it offends your shell but it should work with most versions.