I'm trying to add set -eu option in my script but it's throwing an error "Unbound variable error"
ssh -q $username@$server << EOF
set -eu
echo "proceeding diagnostics"
cd $CT_PATH
bundle exec cap -q -S instance=$instance demo deploy:all;
echo "completed process"
EOF
I would need to add -eu option on the script because -u option can catch non-existent variables.
Appreciate for you quick help on this
CT_PATHandinstance? If you're expecting they will be inherited from the environment on $server, then you need to use<<'EOF', and that's assuming those vars as set withexportin some basic.rcfile that is sourced byssh. Good luck.CT_PATHandinstance, and it is unlikely that bundle will raise this error message, my guess is that one of these variables are not defined. I suggest that you output their values right before theset -eu, for instance like this:echo ${CT_PATH:-undefined} , ${instance:-undefined}.source mySepScript(or. mySepScript), because you must "source" a script for its vars to be visible inside a parent script. If you don't know what I mean search here for[bash] source. Good luck.