SYMPTOM

When executing a SSH command with the "Execute SSH" Action, some environment variables are not loaded / initialized.

It seems that the SSH session does not load the Linux user's environment or profile.


SOLUTION

The Execute SSH action opens a non-interactive shell session on the remote server. With this kind of session, the shell does not load the user's environment and profile scripts (see documentation for bash for example), this is why some environment variables are not available.

Simple test to confirm this case: compare the result of the "set" command in your preferred Terminal application and in the output of Stambia's Execute SSH.

A simple way to load environment variables is to source a config file at the beginning of your Execute SSH action Code:

source /home/user/some_config.sh
echo "$myvar is set"
start_something.sh -o "${~/param}$"