See [this answer](https://stackoverflow.com/a/30984437/10248678) for an in-depth explanation.
– oguz ismailJan 27 '21 at 11:25
Does this case has the same reason: Execute a script having `echo $x` like `x=1 bash script.sh`? Coz this also gives the output as 1. Though comparing x with 2 in the script computes out as true.
– subtleseekerJan 27 '21 at 11:31
Yeah, I tried it again, and its indeed 2 and 2. Not sure, what was different that time. Will re-edit the question to remove this part for future viewers.
– subtleseekerJan 29 '21 at 04:51