I have the env
file:
FOO=123
I need to read it and set its variables. I try to do it in my script:
#!/usr/bin/bash
cat env | grep '^[^#]' | while IFS== read key value; do
echo "echo: $key=$value"
export "$key=$value"
done
echo "FOO -> $FOO"
The output:
echo: FOO=123
FOO ->
Why I get the FOO ->
output instead of FOO -> 123
?