Re: Perl Scripting problem

From: Saxon, Lamar (Lamar.Saxon@AMERICREDIT.COM)
Date: Fri Jul 12 2002 - 19:23:13 EDT


You are absolutely correct... I was short sighted on my answer and was just
replying kermit wasn't the tool for this job.

Thanks !
Lamar

-----Original Message-----
From: Adams Kevin J [mailto:kevin.adams@PHS.COM]
Sent: Friday, July 12, 2002 5:04 PM
To: aix-l@Princeton.EDU
Subject: Re: Perl Scripting problem

Or better yet, sudo; no password prompt.

Kevin Adams

-----Original Message-----
From: Saxon, Lamar [mailto:Lamar.Saxon@AMERICREDIT.COM]
Sent: Friday, July 12, 2002 1:56 PM
To: aix-l@Princeton.EDU
Subject: Re: [aix-l] Perl Scripting problem

I think you might mean expect which is designed to do this...

Lamar

Get it @ Bull...

-----Original Message-----
From: jim kastner [mailto:jim.kastner@NWSCO.COM]
Sent: Friday, July 12, 2002 2:36 PM
To: aix-l@Princeton.EDU
Subject: Re: Perl Scripting problem

Kermit might be the right tool for this job.

-----Original Message-----
From: Dearman, Richard [mailto:rdearm1@UIC.EDU]
Sent: Friday, July 12, 2002 3:13 PM
To: aix-l@Princeton.EDU
Subject: Perl Scripting problem

A friend of mind is having a probelm passing a password to in a perl
script. Any of you Perl wizards out there figure this out and send it to
me. The password she is trying to enter is "candy".

Thanks
Brian

#!/usr/bin/perl

print "su to user oracle\n";

#system("su oracle");

### I need for this script to accept the password candy instead of
prompting me for the password

system('su oracle <<EOF >/dev/null
candy
EOF');

$testoracle = $?;

print "test_oracle = $testoracle\n";

if ($testoracle != 0) {
   print "\n";
   system("mail -s su ccoupet\@blah.com");
   print "Cannot su to user oracle - rc of su is $testoracle\n"; die; }

system("exit");

$testexit = $?;

print "test_exit = $testexit\n";

if ($testexit != 0) {
   print "\n";
   system("mail -s su ccoupet\@blah.com");
   print "Cannot exit from su to user oracle - rc of su is $testexit\n";
die; }

print "successfull exit from user oracle\n";

***************************EMAIL DISCLAIMER***************************
This email and any files transmitted with it may be confidential and are
intended solely for the use of th individual or entity to whom they are
addressed. If you are not the intended recipient or the individual
responsible for delivering the e-mail to the intended recipient, any
disclosure, copying, distribution or any action taken or omitted to be
taken in reliance on it, is strictly prohibited. If you have received
this e-mail in error, please delete it and notify the sender or contact
Health Information Management 312.996.3941.

This electronic message transmission, including any attachments, contains
information from PacifiCare Health Systems Inc. which may be confidential or
privileged. The information is intended to be for the use of the individual
or entity named above. If you are not the intended recipient, be aware that
any disclosure, copying, distribution or use of the contents of this
information is prohibited.

If you have received this electronic transmission in error, please notify
the sender immediately by a "reply to sender only" message and destroy all
electronic and hard copies of the communication, including attachments.



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:03 EDT