LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-31-2005, 05:41 PM   #1
raypen
Member
 
Registered: Jun 2002
Location: Midwest
Distribution: Slackware
Posts: 365

Rep: Reputation: 30
expectk problem


I have been using an expect script to mount a file share in Samba
which works very well and have decided to create a similar on using
expectk so that a processing window will appear on my KDE desktop
telling me when the process is complete. However the script is aborting
prematurely:

Expect script:

#! /usr/bin/expect -f
spawn smbmount //Win2K/C /mnt/share
expect "Password:"
exec sleep 1
send "\r"
expect eof

Expectk script:

#! /usr/bin/expectk -f
button .ok -text {Running SMBmount} -command exit
pack .ok -fill x -fill y
spawn smbmount //wIN2k/C /mnt/share
expect "Password:"
exec sleep 1
send "\r"
expect eof
.ok config -text {Click to Continue}

The error I'm getting:
Password: Error in startup script: wrong args: should be "send ?options? inter
pName arg ?arg ...?
while executing
"send "/r""
(file "smb-tk" Line 7)
Aborted


Can anyone offer some help here?
 
Old 02-01-2005, 04:59 PM   #2
raypen
Member
 
Registered: Jun 2002
Location: Midwest
Distribution: Slackware
Posts: 365

Original Poster
Rep: Reputation: 30
I gather from the lack of rersponse that there are not a lot of
TCL/Tk experts out there. In fact I have never seen any questions
about the Tool Command Language in these forums.

Well, I got lucky playing around and uncovered the following:

Expect will allow (actually expects) the following syntax:

send "/r"

However, expectk does not like this for some reason and will
only allow:

exp_send "/r"

Happy camper!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
perl problem? apache problem? cgi problem? WorldBuilder Linux - Software 1 09-17-2003 07:45 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration