Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   Sending commands to new shell in Perl (http://www.velocityreviews.com/forums/t892675-sending-commands-to-new-shell-in-perl.html)

mario.demiguel@gmail.com 06-02-2005 08:34 PM

Sending commands to new shell in Perl
 
I am trying to do the following in a Perl script:

ssh to a remote machine
once on the machine, switch to tcsh
once in tcsh, execute commands

I am a relative novice at Perl and would appreciate any help or
suggestions. Thanks in advance!


J. Gleixner 06-02-2005 10:36 PM

Re: Sending commands to new shell in Perl
 
mario.demiguel@gmail.com wrote:
> I am trying to do the following in a Perl script:
>
> ssh to a remote machine
> once on the machine, switch to tcsh
> once in tcsh, execute commands


Take a look at the Expect module on CPAN (http://search.cpan.org/).
Also, using one of the many search engines first & frequently, probably
will save you a lot of time in the future.

Once you have read the documentation and tried to use it, then you can
post specific questions about your code.

>
> I am a relative novice at Perl and would appreciate any help or
> suggestions. Thanks in advance!


No need to state the obvious. :-)

Robert Gamble 06-03-2005 12:02 AM

Re: Sending commands to new shell in Perl
 
mario.demiguel@gmail.com wrote:
> I am trying to do the following in a Perl script:
>
> ssh to a remote machine
> once on the machine, switch to tcsh
> once in tcsh, execute commands
>
> I am a relative novice at Perl and would appreciate any help or
> suggestions. Thanks in advance!


Take a look at the Net::SSH::Perl module on cpan.org

Robert Gamble


Tintin 06-04-2005 02:16 AM

Re: Sending commands to new shell in Perl
 

<mario.demiguel@gmail.com> wrote in message
news:1117744458.014679.241550@g14g2000cwa.googlegr oups.com...
>I am trying to do the following in a Perl script:
>
> ssh to a remote machine
> once on the machine, switch to tcsh
> once in tcsh, execute commands


What's the reliance on tcsh? Without knowing your requirements, it maybe a
simple as doing:

ssh user@remote command

Either invoked via system, or using one of the Perl SSH modules.




All times are GMT. The time now is 07:32 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.