you would have to use a pipe instead of a redirect, i.e. open (SPAMCFG, "|ssh u...@remotehost 'cat >> /home/user/logfile'")
On 5/11/09, Nelson Serafica <[email protected]> wrote: > I'm not good on perl scripting but I have some knowledge on bash scripting > and basic on perl. > > I need to modify a perl script. As of the moment, it is dumping to a file > in their home directory. I need to output it also to one of my server > outside the network. I wanna do it via ssh using empty passphrase key. I > have already setup my machine to connect via ssh with no password. > > Here is the sample snippet. How could I redirect the output of SPAMCFG to > my remote server instead to $homedir. > > open(SPAMCFG,">$homedir/mailspamcheck_settings.pl"); > print SPAMCFG ("#\!\/usr\/bin\/perl\n\n\n"); > print SPAMCFG ("#whitelist $username start\n"); > > Is is possible that I could output the SPAMCFG to my remote server using > SSH?? > > open(SPAMCFG,"><REMOTE SERVER USERS's > MAILDIR>/mailspamcheck_settings.pl"); > print SPAMCFG ("#\!\/usr\/bin\/perl\n\n\n"); > print SPAMCFG ("#whitelist $username start\n"); > > > > > > -- Daniel --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Linux Users Group. To post a message, send email to [email protected] To unsubscribe, send email to [email protected] For more options, visit our group at http://groups.google.com/group/linuxusersgroup -~----------~----~----~----~------~----~------~--~---
