There is a shell script name example.sh on server. I want to run it using my shell script. The shell script will be run on my system so server's shell script will be run.
What should be in my shell script so with that I can run server's shell script?
Server IP - 192.168.0.1
when I run
so I am logged into server.
Now I reach into the directory where shell script is available.
Code:
$ cd /home/user/scripts/example.sh
Now I run the script using
I have to do this 100 times in a day so above steps are so annoying.
That's why I want to include these steps in my shell script so when I will run my script on my system, server's script will be run.
Right now my shell script is
Code:
#!/bin/bash
ssh 192.168.0.1
cd /home/user/scripts/example.sh
./example.sh
When I run this, it is logged into server and shows server's command prompt
but it does not run next steps
cd /home/user/scripts/example.sh
./example.sh
It is stopped on server's command prompt.
Please help