rogeriovinhal
March 19th, 2006, 07:04 PM
Hi, I am kind of a newbie in script programming, I have only programmed in commom languages like C, Java, etc.
I need to make 2 scripts that would make my life a lot easier. One of the is to use the SSH command twice to different machines, and then call the program PINE. That is because I have first to log in a server, and then I have to log in a commom machine in a network. That requires two commands of ssh for different machines, and the same authentication for both.
Is there a way to make a script to do that? Because every script that I try to make only calls the first SSH, and after the first authentication, it keeps waiting until I finish it.
The second script is a lot easier I guess, I have to log in the server machine as I said before, and then make a file transfer to the machine I connected. This requires 2 arguments from the command line, one for the files to send, and one for the location to put them after logging in the server.
For that I thought I could use SFTP, but for the same problem of the other program, I can't make it work. Someone told me to use SCP, but I read some manpages about SCP and it seems to do the oposite, not send, only download.
Anyone knows anything of that and could give me some directions or commands to start the scripts?
Thanks.
I need to make 2 scripts that would make my life a lot easier. One of the is to use the SSH command twice to different machines, and then call the program PINE. That is because I have first to log in a server, and then I have to log in a commom machine in a network. That requires two commands of ssh for different machines, and the same authentication for both.
Is there a way to make a script to do that? Because every script that I try to make only calls the first SSH, and after the first authentication, it keeps waiting until I finish it.
The second script is a lot easier I guess, I have to log in the server machine as I said before, and then make a file transfer to the machine I connected. This requires 2 arguments from the command line, one for the files to send, and one for the location to put them after logging in the server.
For that I thought I could use SFTP, but for the same problem of the other program, I can't make it work. Someone told me to use SCP, but I read some manpages about SCP and it seems to do the oposite, not send, only download.
Anyone knows anything of that and could give me some directions or commands to start the scripts?
Thanks.