[dundee] Scripting across logins

Andrew Clayton andrew at digital-domain.net
Mon Jan 9 23:19:38 GMT 2006


On Mon, 2006-01-09 at 11:19 +0000, Martin Habets wrote:
> On Sat, Jan 07, 2006 at 07:00:27PM +0000, Fionnbar Lenihan wrote:
> > Hi Martin
> > 
> > Thank you very much for the detailed reply
> > 
> > I probably didn't make myself clear.  Printer is recognised fine by  
> > OS X.  The problem is that the driver which used to work under Jaguar  
> > 10.3 now doesn't under OS X.4
> 
> Do you have any idea what this 'driver' is exactly? Since OS X recognizes
> the printer it's not an OS driver you're talking about, but rather some
> library or daemon.
> What indication do you have that OS X has recognized the printer?
> 
> > I would be concerned that if I followed your advice and connected via  
> > the lpd interface on my iBook I would run into the same driver problem?
> 
> I would expect that the old lpd technology and newer network-printer
> stuff is separated. And I would expect it to just work on any unix machine.
> After all, it's only about 34 years old :)
> 
> > My print to PS, copy to remote machine, throw against remote LPR  
> > method works fine, just very laborious.
> > 
> > Have you any thoughts about expect scripting it?
> 
> Sorry, no clue what 'expect' is. I usually write shell scripts, they
> could/should work on *nix.

Expect lets you automate interactivity... you can do it with shell but
expect was designed for it.

shell:

#!/bin/sh

cd /tmp
ncftp localhost <<EOF
cd tmp/wintv
mget *.html
bye
EOF


ftp's to a host and downloads some files.


Heres a simple expect script I wrote a while back... it just telnets to
a host, logs you in and executes some command you pass to it..

e.g ./autotelnet ls


#!/usr/bin/expect -f

send_user "$argv0 [lrange $argv 0 2]\n"
spawn telnet HOST
expect "login:"
send "USERNAME\r";
expect "Password:";
send "PASSWORD\r";
expect "$ ";
send "$argv\r";
expect "$ ";
send "exit\r";



Andrew





More information about the dundee mailing list