Issue
Why doesn't this work?
HELLO=WORLD echo $HELLO
In my shell it outputs
Solution
The issue is that bash is evaluating and replacing $HELLO
before your command executes. If you write a script like:
echo $HELLO
and run HELLO=WORLD ./script
, you will see the expected output.
Answered By - Carson Answer Checked By - Marie Seifert (WPSolving Admin)