Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Hi All, I have a situation where in I am calling the below Perl script

if (param("lremail") && param("lot")) { my $address=param("lremailaddress"); my $lot=param("lot"); print a({-href=>"$dir/new.pl"},"Back to Top"),br; print "Request submitted for $address.",br; print "Lot $lot",br; print "You will receive an e-mail with a link to the data when the + request is complete."; print end_html; system ("ssh SERVERNAME /test/abc.csh $lot $$ $address &"); exit(1);

The above script does not run because, when I execute the script its asking for a system password. Then I researched a little and wrote the below command..

expect -c 'spawn ssh SERVERNAME /test/abc.csh J213520 06 abc@gmail.com + "ls -lh file"; expect "Password:"; send "PASSWORD\r"; interact'

Now this command is executed successfully without any issue but from the command line only. When I incorporate the same(by replacing the system call) within the Perl script, it fails. How can I incorporate this line within the perl script?


In reply to How to incorporate Expect in Perl Script? OR Pass the password via perl script? by prad001

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-20 00:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found