![]() |
|
|
|||||||
| Home | Forums | Register | Rules & FAQ | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Security Anything involving computer security goes here. |
Other UNIX.COM Threads You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| For Loops Within Ftp Comands | jsalz638 | UNIX for Advanced & Expert Users | 6 | 10-21-2007 08:20 PM |
| sql inside a script | kotasateesh | Shell Programming and Scripting | 4 | 04-26-2006 10:30 AM |
| how to find Script file location inside script | asami | Shell Programming and Scripting | 10 | 03-14-2006 08:57 PM |
| how to identify the type of shell using comands.. | swamymns | Shell Programming and Scripting | 2 | 01-17-2006 09:17 PM |
| External comands in C? | merlin | High Level Programming | 2 | 01-07-2003 09:15 PM |
![]() |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
comands inside the script
hi,
i want to put a set of commands inside a script and executing commands sequentially. there are 2 commands, the first command copies the program from my machine to another machine, execute it and get the result on my machine. the second command removes the program which was copied to the remote machine. I have already made the ssh authentication. I need to integrate both of them in one single script so that if i run that script it gives the result. Can somebody give some suggestions? first command Code:
cat /path of my machine/script.pl | ssh user@remotemachine "cat > /path of the remote server where the file is copied/backup_script.pl ; perl /path of the remote server where the file is copied/backup_script.pl Code:
ssh user@remotemachine rm /path of the remote server where the file is copied/backup_script.pl |
| Forum Sponsor | ||
|
|
|
|||
|
Thanks a lot Lakris...
Code:
#!/bin/sh scp script.pl user@remote:remote path result=$(ssh user@remote script.pl) echo $result ssh user@remote rm script.pl thanks. |