Sponsored Content
Top Forums UNIX for Dummies Questions & Answers expect and stty paths are different and resulting in error. Post 302215039 by The Nemi on Tuesday 15th of July 2008 11:27:19 AM
Old 07-15-2008
Question expect and stty paths are different and resulting in error.

Hello,

i am using expect to automate file transfers to and fro with a sftp server.

below is the script i am creating and executing in the main program.
Quote:
#!/usr/local/bin/expect
spawn ftp user@ftpsite.com
expect "username:"
send "user\r"
expect "password:"
send "passwd\r"
expect "ftp>"
send "binary\r"
expect "ftp>"
send "cd /path/on/ftp/server/\r"
expect "ftp>"
send "ls -l filename_*.pgp\r"
expect "ftp>"
send "bye\r"
interact
but i am getting the following error:

Quote:
spawn ftp ftp_server
sh: /usr/local/bin/stty: not found
Connected to ftp_server.
220 ftp_server FTP server (SunOS 5.8) ready.
Name (ftp_server:user): user
331 Password required for user.
Password:
230 User user logged in.
ftp> binary
200 Type set to I.
ftp> cd /path/on/ftp/server/
250 CWD command successful.
ftp> ls -l filename_*.pgp
200 PORT command successful.
150 ASCII data connection for /bin/ls (ftp_server,11111) (0 bytes).
226 ASCII Transfer complete.
local: filename.txt.r.pgp remote: -l
90 bytes received in 0.0042 seconds (21.02 Kbytes/s)
ftp> bye
221 Goodbye.
Quote:
sh: /usr/local/bin/stty: not found
the main program that creates and runs this script looks for words like "not found" in the log file that is created and decides whether there was an error in the sftp process. In this case there is an error.

i am on working on SunOS 5.8 korn shell. i did some research on this and found out that the "expect" program is in the "/usr/local/bin" folder and stty is in "/usr/bin".

i also check the $PATH variable and both "/usr/local/bin" and "/usr/bin" are present.

can anyone help me with this particular issue? any help appriciated.

Thank you.

Last edited by The Nemi; 07-16-2008 at 12:47 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ctrl+S resulting in (i-search) in bash

Hi On solaris, when I press Ctrl+S on an XTERM, the window normally freezes. But today on the same machine, the Ctrl+S key results in (i-search) !! I understand that it has got something to do with emacs (may be not). But I do not use emacs at all. Other specific keys including <backspace>,... (3 Replies)
Discussion started by: balaji280283
3 Replies

2. UNIX for Advanced & Expert Users

stty: error occurs when installing rpm

Hello All, when I install rpm rpm --install rpm packagename I got the following errors stty:standard input:invalid argument stty:standard input:invalid argument I dont know what i have to do exactly. I search on google for the same but not a particular standard solution is given... (17 Replies)
Discussion started by: amitpansuria
17 Replies

3. Shell Programming and Scripting

bash: dividing/multiplying variables resulting in decimals

(4 Replies)
Discussion started by: puddy
4 Replies

4. UNIX for Dummies Questions & Answers

stty: : Not a typewriter with AUTOSYS error

(sys10:pt:/pf>) cat 122974qqq.s RUNAS Version 2007.10.07 Run on Dec 11 2008 10:09:36 AM UNIX Process: 26021 Login User : root PFW User : s08280 Not a terminal stty: : Not a typewriter stty: : Not a typewriter ksh: jil: not found ksh: sendevent: not found... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

5. Solaris

SC3.2 issue - cluster transport configuration not right - resulting fail

I am trying to set up a two host cluster. trouble is with the cluster transport configuration. i'm using e1000g2 and g3 for the cluster transport. global0 and global1 are my two nodes, and I am running the scinstall from global1. i think i should be expecting, is this: The following... (19 Replies)
Discussion started by: frustin
19 Replies

6. Shell Programming and Scripting

stty error when script is called out of a cronjob

Hello, I'm trying to implement a script to call a third-party tool every so often and write the results to a file. If I run it interactively it works fine, but when it comes to run it out of a cronjob, I keep getting this error: stty: tcgetattr: a specified file does not support the... (3 Replies)
Discussion started by: fabiogilr
3 Replies

7. Shell Programming and Scripting

stty: : I/O Error

Hi all, I am stuck on a shell script issue and need your inputs: I have a parent script A.ksh which call in another script B.ksh. At the start of the B.ksh, we export the .profile of another user and then call Informatica jobs. Issue When I run my jobs from the command prompt, it works... (1 Reply)
Discussion started by: fromrishi
1 Replies

8. Red Hat

Server load rapidly increases resulting in complete freeze

Hi All, I run Linux server that hosts PHP/MySQL web-projects. The problem is that it becomes irresponsive periodically, avg. load rapidly goes up to 100.0 and more and I have to do cold reboot. Usually this sudden increase happens in 1-2 mins and it's very difficult to catch this moment in... (0 Replies)
Discussion started by: livedatesearch
0 Replies

9. Emergency UNIX and Linux Support

Zip all the files resulting from a sed command

hi guys i have a file in this location /home/test/Summary.txt - this file contants is a below ./log_SI-100.lst:Error detected, rollbacking ./log_SI-101.lst:Error detected, rollbacking ./log_SI-106.lst:Error detected, rollbacking i use this command to get the log file names inside it ... (2 Replies)
Discussion started by: depakjan
2 Replies

10. Shell Programming and Scripting

Expect Script not running from cron. Full Paths used

My cron file. Copied $PATH # Minute Hour Day of Month Month Day of Week Command SHELL=/bin/ksh PATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/perl/lib:/perl/lib/lib/perl5:/perl/scripts:.:/perl/lib/local:/home/popeye:/temp 0... (3 Replies)
Discussion started by: popeye
3 Replies
SIMPLEFTP(1)						    InterNetNews Documentation						      SIMPLEFTP(1)

NAME
simpleftp - Rudimentary FTP client SYNOPSIS
simpleftp url [...] DESCRIPTION
simpleftp is a Perl script that provides basic support for fetching files with FTP in a batch oriented fashion. It takes one or more FTP URLs on the command line. The file(s) will be retrieved from the remote server and placed in the current directory with the same basename as on the remote; e.g., <ftp://ftp.isc.org/pub/usenet/CONFIG/active.gz> is stored as active.gz in the current directory. The script properly understands usernames, passwords and ports specified as follows: ftp://user:password@host:port/path/file BUGS
simpleftp is an extremely poor substitute for more complete programs like the freely available wget or ncftp utilities. It was written only to provide elementary support in INN for non-interactive fetching of the files in <ftp://ftp.isc.org/pub/pgpcontrol/> or <ftp://ftp.isc.org/pub/usenet/CONFIG/> without requiring administrators to install yet another package. Its shortcomings as a general purpose program are too numerous to mention, but one that stands out is that downloaded files by simpleftp override existing files with the same name in the local directory. HISTORY
Tossed off by David C Lawrence <tale@isc.org> for InterNetNews. Rewritten to use "Net::FTP" by Julien Elie. $Id: simpleftp.pod 8357 2009-02-27 17:56:00Z iulius $ SEE ALSO
actsync(8). INN 2.5.2 2009-05-21 SIMPLEFTP(1)
All times are GMT -4. The time now is 09:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy