executing multiple commands by ssh
Hi, i'm writing a bash script so that i can
login into a machine by ssh AND run multiple commands on that
machine....anybody knows that??
what i know now is to run a single command like:
$ssh root@ip_address command1
but how to run multiple commands??
Is this what you want:
$ ssh email@example.com "ls -l / | grep tmp ; echo 'A rather dumb example'"
drwxrwxrwt 3 root root 12288 Oct 22 21:05 tmp
A rather dumb example
It's not a very usable example, but it shows that it is possible to use a command (ls -l) pipe it to another program (grep) and prints a message (echo).
Hope this helps.
|All times are GMT -5. The time now is 11:56 PM.|