0

If I do this (with no control operator after the variable assignment)

$ A=1 echo $A

Nothing.

but if I

$ A=1 bash -c 'echo $A'
1

Why isn't the first A 1? Thanks!

kserwick
  • 21
  • 3
  • 2
    this is a common question. see here. https://stackoverflow.com/questions/10938483/why-cant-i-specify-an-environment-variable-and-echo-it-in-the-same-command-line – toppk Sep 07 '22 at 03:27

0 Answers0