Hi folks,
I have a perl script that issue SecureFTP(sftp) to automate the file
transfer and the password prompt.
When the script runs in the foreground, it works, and it takes the
password.
Example:
[echen@startnet11 ~]$ ksh EDC.ksh Eddie.cmd
[email protected]'s password:
sftp> put zvm.note zvm.note
Uploading zvm.note to /users/nyse/zvm.note
sftp> ls -l zvm.note
-rwxr-x--- 0 0 0 667 Jul 12 19:08 zvm.note
sftp> bye
Note: The input file "Eddie.cmd" contains the userid and password.
When I run the script in background, the password prompts comes back to
my terminal and not to the script.
Example:
[echen@startnet11 ~]$ ksh EDC.ksh Eddie.cmd&
[17] 8228
[email protected]'s password:
Also when I do the "ps" I see the script sitting idle.
echen 27044 27043 0 18:08 pts/9 00:00:00 sftp -b
/tmp/sftp_batch27041 [email protected]
the question is, is there other way where I can get password working running
in the background.
my $expect = Expect->spawn("sftp -o 'BatchMode no' -b $BATCH $user\@$host");
$expect->expect(10,"password:");
$expect->send("$password\n");
$expect->interact;
Please consider the environment before printing this email.
Visit our website at http://www.nyse.com
****************************************************
Note: The information contained in this message and any attachment to it is
privileged, confidential and protected from disclosure. If the reader of this
message is not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, you are hereby notified that
any dissemination, distribution or copying of this communication is strictly
prohibited. If you have received this communication in error, please notify
the sender immediately by replying to the message, and please delete it from
your system. Thank you. NYSE Euronext.
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/