Welcome Guest! Log in
Due to some maintenance operations, stambia.org will be switched to read-only mode during the 13th November. It will be possible to read and download, but impossible to post on the forums or create new accounts. For any question please contact the support team.


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 environement 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 prefered 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}$"

 

You have no rights to post comments

Knowledge Base

Suggest a new Article!