The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Security
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-13-2008
mercuryshipzz mercuryshipzz is offline
Registered User
 

Join Date: Dec 2007
Posts: 16
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
second command: removing the file after executing

Code:
ssh user@remotemachine rm /path of the remote server where the file is copied/backup_script.pl
thanks.
Reply With Quote
Forum Sponsor