I want to get a variable from another script, as demonstrated in this question on Stack Overflow:
However, the answer uses the
source command which is only available in
bash. I want to do this in a portable way.
I have also tried
export VAR="foo" echo "executing a"
#!/bin/sh ./a.sh echo $VAR
But of course that does not work either. How to do this?