views:

103

answers:

1

Hi,

I am new to the linux/unix world. I would like to trigger a make on a remote machine. For this purpose i created a little script on the remote machine which i want to execute via ssh.

The script looks something like this:

echo "loading .profile"
. ~/.profile
echo "profile loaded"
echo "starting gmake"
cd ~/helloWorld/
gmake all

I invoke the script with following ssh command:

ssh user@remotehost "cd ~/helloWorld && ./myscript.sh"

When I execute this command my machine connects to the remote machine. It tells me that the profile is loaded and then i have to press [CTRL]+[D] to continue with the script. So it seems that the . ./myscript.sh command creates something like a new terminal. I dont want this behaviour. I would like to use the ssh command to automate the building process without the need of closing the terminal manually. Is there a way to do this?

Thanking you in anticipation, John

A: 

./source does not invoke a new shell. It runs the commands in the script in the current shell. Something else is going wrong.

Ignacio Vazquez-Abrams
Oh thank you so much. You are right. The . /source command does not invoke a new shell. But in my case it did. I have got a big default .profile-file from my company and in same place a new bash is opened there. Without this line everything works fine.Thanks!!!
John