I use a script, test.sh, written by someone else, the begins with a bash shebang:
#!/bin/bash -l
...
echo TEST: $TEST
From what I could see, this has an effect on variables used inside the script:
- if I run
TEST=hey ./test.sh, I can seeTEST: hop,hopbeing the value of variableTESTin my.bash_profile - this is the same if I
export TEST=heybefore running the script - but if I remove the
-lflag, the same command returnsTEST: hey, as I would have expected
Can someone please explain this behaviour ? The help of bash did not... help.