Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Sending commands to new shell in Perl

Reply
Thread Tools

Sending commands to new shell in Perl

 
 
mario.demiguel@gmail.com
Guest
Posts: n/a
 
      06-02-2005
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!

 
Reply With Quote
 
 
 
 
J. Gleixner
Guest
Posts: n/a
 
      06-02-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) 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.
 
Reply With Quote
 
 
 
 
Robert Gamble
Guest
Posts: n/a
 
      06-03-2005
(E-Mail Removed) 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:erl module on cpan.org

Robert Gamble

 
Reply With Quote
 
Tintin
Guest
Posts: n/a
 
      06-04-2005

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Permission denied trying to execute shell commands from Perl/CGI. oleg106@yahoo.com Perl Misc 3 08-24-2006 09:14 AM
executing commands in the same shell in Windows using Perl Murugesh Perl Misc 5 12-07-2005 04:25 PM
aliased shell commands from perl script Dmitry Perl Misc 2 07-12-2004 05:21 PM
sending stdin to a shell command in perl Andrew Perl Misc 7 11-25-2003 03:41 PM
Re: man pages for C commands (GCC commands) Ben Pfaff C Programming 4 06-28-2003 06:21 PM



Advertisments