I have the following scenario, I have script that runs bash script on another remote machine
The command to ssh is
ssh firstname.lastname@example.org 'bash -s' < test.sh
#/bin/sh bash ./trigger.sh
trigger.sh (Remote server)
docker build -t nginx .
I need to change the directory before executing the script
trigger.sh. For instance like this:
ssh email@example.com 'cd /pipeline' 'bash -s' < test.sh
I tried with cd but I am getting error bash line 0:cd: too many arguments
Help is highly appreciated how to accomplish this, or is there any other way for the above scenario.