how to run perl script inside the expect script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sangeetha
    New Member
    • Jul 2006
    • 1

    how to run perl script inside the expect script

    hi everybody
    i want to run one perl script with three inputs inside the expect
    script
    i dont know how to automatically run the perl script with three inputs
    ....

    can u please guide me asap....


    thanx n adv
    sk
  • dhascruz
    New Member
    • Aug 2006
    • 3

    #2
    Hi,

    if you want to run the script with three input, You can get the three inputs through arguments.

    ex.
    perl test.pl arg1, arg2, arg3

    Test.pl

    use strict;
    my(val1,val2, val3 )=($ARGV[0],$ARGV[1],$ARGV[2]);

    Comment

    • docsnyder
      New Member
      • Dec 2006
      • 88

      #3
      Expect allows you to send commands to the shell of a remote host.

      If you want to execute a Perl script at the remote host, you either have to copy the respective script to the remote host, or (e.g. if you don't have permissions to do so), you could execute Perl code via the command line, e.g.:

      Code:
      perl -e 'print "hello\n"'
      Hope this helps ...

      Greetz, Doc

      Comment

      Working...