|
The \n after mput and quit.
Kevin Bucknum
Senior Programmer Analyst
MEDDATA/MEDTRON
Tel: 985-893-2550
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalfinteractive.
Of Jay Vaughn
Sent: Thursday, May 3, 2018 10:16 AM
To: Midrange Systems Technical Discussion
Subject: Re: trouble installing EXPECT using Scott Klement Reference
no - where are they in yours?
#!/usr/local/bin/expect -f
spawn sftp -oPort=9002 xxx@1.1.1.1
expect "password:"
send abc123n"
expect "sftp>"
send "mput *\n"
expect "sftp>"
send "quit\n"
On Thu, May 3, 2018 at 11:10 AM, Kevin Bucknum
<Kevin@xxxxxxxxxxxxxxxxxxx>
wrote:
Are you sending the CR after your FTP commands? I don't see them in
the script. That is the equivalent of hitting enter if you were
ReferenceBehalf
Kevin Bucknum
Senior Programmer Analyst
MEDDATA/MEDTRON
Tel: 985-893-2550
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On
Of Jay Vaughn
Sent: Thursday, May 3, 2018 9:36 AM
To: Midrange Systems Technical Discussion
Subject: Re: trouble installing EXPECT using Scott Klement
"expect"password:"
kevin... looks like i about go this going...
here is my script...
#!/usr/local/bin/expect -f
set timeout 20
spawn sftp -vvv -oport=22 LSAMSSO@10.110.4.99 expect {
default {exit 2}
"continue connecting (yes/no)?" {send "yes\n"; exp_continue}
[send "*********\n"; exp_continue} "sftp>"my
}
send "lcd /lsams/sftp/export"
expect "sftp>"
send "cd /put/lsams/sftp/export"
expect "sftp>"
send "PUT srvbill.ZIP"
expect "sftp>"
send "lcd /tmp"
expect "sftp>"
send "cd /put/lsams/sftp/export"
expect "sftp>"
send "GET srvbill.ZIP"
expect "sftp>"
expect {
default {exit 2}
"not found" {exit 3}
"sftp>"
}
send "quit\n"
exit 0
so looks like i'm getting through the password authentication
however
sftp command do not seem to be working.srvbill.ZIPlcd
last few lines in log show...
debug3: Sent message fd 5 T:16 I:1
debug3: SSH_FXP_REALPATH . -> /home/lsamsso
sftp> lcd /lsams/sftp/exportcd /put/lsams/sftp/exportPUT
/tmpcd /put/lsams/sftp/exportGET srvbill.ZIP
obviously i'm not doing something right with the "send" and
it"sftp>"
commands... but can you see what the issue is?
Jay
On Thu, May 3, 2018 at 9:08 AM, Kevin Bucknum
<Kevin@xxxxxxxxxxxxxxxxxxx>
wrote:
All of the sftp commands will need to be in expect script. Spawn
starts the sftp connection inside of the expect script. Expect
waits for certain text, and then when it sees it, sends the
response. The script below is very basic, but there plenty of
examples of complex scripts out there. Ours starts the sftp
session and waits for the other side to send "password:" When
Itscript).sees that, it sends our password (I see I striped out a " when I
was sanitizing that
sendsIt then waits for it come back to command prompt "sftp>" When it
that, it sent our put command and a carriage return. "mput *\n"
fordisconnect.waits for the command prompt again, and then sends quit to
ReferenceBehalf
Kevin Bucknum
Senior Programmer Analyst
MEDDATA/MEDTRON
Tel: 985-893-2550
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On
Of Jay Vaughn
Sent: Thursday, May 3, 2018 7:58 AM
To: Midrange Systems Technical Discussion
Subject: Re: trouble installing EXPECT using Scott Klement
also...
kevin...
we have key auth working for sftp but want to allow user
password
so obviously why i'm pursuing expect...
using EXPECT, can I simply spawn the same sftp command I use
+key
auth...??
l_sftpCommand = 'PATH=$PATH:/QOpenSys/usr/bin && sftp '
+'-vvv '
+'-oport=' + %trim(l_port) + ' '
+'-b /tmp/sftpBatchFile.BCH '
specify%trim(l_userName) + '@' + %trim(l_host);
so basically in my EXPECT script, i say "spawn" and then
sftpthe
same sftp
command above and it will utilize the batch file? or do my
iget/put
commands need to be built into the EXPECT script?
On Thu, May 3, 2018 at 8:53 AM, Jay Vaughn
<jeffersonvaughn@xxxxxxxxx>
wrote:
i seeeeee... ok getting a better picture of all this - i did
understand that EXPECT mimic'd someone at a terminal... but
justsee
the
spawn command will do what I need for the sftp execution
On Thu, May 3, 2018 at 8:51 AM, Kevin Bucknum
<Kevin@xxxxxxxxxxxxxxxxxxx>
wrote:
Expect doesn't change anything about using sftp. Expect
scripts.asks
like a person typing at a terminal. Here is one of our
Klementbounces@xxxxxxxxxxxx]
#!/usr/local/bin/expect -f
spawn sftp -oPort=9002 xxx@1.1.1.1 expect "password:"
send abc123n"
expect "sftp>"
send "mput *\n"
expect "sftp>"
send "quit\n"
Kevin Bucknum
Senior Programmer Analyst
MEDDATA/MEDTRON
Tel: 985-893-2550
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-
On
Behalf
Of Jay Vaughn
Sent: Thursday, May 3, 2018 7:47 AM
To: Midrange Systems Technical Discussion
Subject: Re: trouble installing EXPECT using Scott
toReference
also, by using EXPECT (instead of SFTP), is there a way
itspecify
theport to
use?
On Thu, May 3, 2018 at 8:45 AM, Jay Vaughn
<jeffersonvaughn@xxxxxxxxx>
wrote:
indeed - thank you - let me go from here...
On Thu, May 3, 2018 at 8:41 AM, Kevin Bucknum
<Kevin@xxxxxxxxxxxxxxxxxxx>
wrote:
It looks to me like if you follow those instructions
wouldbewould
at /usr/bin/expect. If you want it in qopensys you
Klementoption)toneed
either
copy/move it, or create a symbolic link (the better
bounces@xxxxxxxxxxxx]
Kevin Bucknum
Senior Programmer Analyst MEDDATA/MEDTRON
Tel: 985-893-2550
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-
On
Behalf
Of Jay Vaughn
Sent: Thursday, May 3, 2018 7:35 AM
To: Midrange Systems Technical Discussion
Subject: trouble installing EXPECT using Scott
WhatusingReference
Hopefully someone can help...
I'm following the short instructions in this link...
https://www.scottklement.com/expect/
however, when I am done and check for the expect
command
the
following command, I do not see it...
WRKLNK OBJ('/qopensys/usr/bin/expect')
It appears i am not doing the install correctly.
subscriptionam
posting,(MIDRANGE-L)missing?I
Jay
--
This is the Midrange Systems Technical Discussion
https://lists.midrange.com/mailman/listinfo/midrange-lsubscribe,mailinglist
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To
unsubscribe, or change list options,
visit:
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before
Toplease take a moment to review the archives at--
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any
subscription related questions.
Help support midrange.com by shopping at amazon.com
with our affiliate
link: http://amzn.to/2dEadiD
This is the Midrange Systems Technical Discussion
(MIDRANGE-L) mailing list To post a message email:
MIDRANGE-L@xxxxxxxxxxxx
pleasesubscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before
posting,
take
a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any
withrelated
questions.
Help support midrange.com by shopping at amazon.com
https://lists.midrange.com/mailman/listinfo/midrange-lour
(MIDRANGE-L)--affiliate
link: http://amzn.to/2dEadiD
This is the Midrange Systems Technical Discussion
Tosubscribe,mailinglist
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To
unsubscribe, or change list options,--
visit:
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting,
please take a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription
related questions.
Help support midrange.com by shopping at amazon.com with
our affiliate
link: http://amzn.to/2dEadiD
This is the Midrange Systems Technical Discussion
(MIDRANGE-L) mailing list To post a message email:
MIDRANGE-L@xxxxxxxxxxxx
subscribe, unsubscribe, or change list options,
visit:
ourrelatedpleaseor email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting,
take
a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription
questions.
Help support midrange.com by shopping at amazon.com with
relatedpleaselist--affiliate
link: http://amzn.to/2dEadiD
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting,
take a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription
mailingmailingquestions.--
Help support midrange.com by shopping at amazon.com with our
affiliate
link: http://amzn.to/2dEadiD
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
affiliatelist To post a message email: MIDRANGE-L@xxxxxxxxxxxx Totake
subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our
listlink: http://amzn.to/2dEadiD--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,--
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
take a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our
affiliate
link: http://amzn.to/2dEadiD
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
affiliatelist To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,take
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our
listlink: http://amzn.to/2dEadiD--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,--
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.