I'm trying to execute the remote local script with ssh connection. I've read a document about the syntax of it. But my issue is that, before running the script, I need to execute bash and source environment variables.
This looks appropriate for me but it has not a source command :
ssh [user]@[server] 'bash -s' < [local_script]
/usr/bin/ssh "$user@$$host" <<EOF
i fixed problem as writing another template script which source the environment variables and run the script. And it hopefully works.
PROFILE=/dir/to/profile/.profile source $PROFILE cd /dir/to/script /bin/bash script $1
If you use source command with bash shell, #!/bin/bash doesn't work for source command.
Thank you for all your comments.