Running vs Sourcing
setenv.sh contains export API_URL=https://api.example.test. You run ./setenv.sh, but $API_URL is empty afterwards. Why?
setenv.sh
export API_URL=https://api.example.test
./setenv.sh
$API_URL
Choose one answer
Variables containing :// are rejected by bash.
://
export only works inside functions.
export
The script must first be made executable with chmod +x, or exports are ignored.
chmod +x
It ran in a child process; use source instead.
source