I want to get a variable from another script, as demonstrated in
However, the answer uses
source command 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?