Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: shell script question< Next Oldest | Next Newest >
kagrecu Offline

Group: Members
Posts: 7
Joined: May 2005
Posted: Aug. 23 2005,22:40 QUOTE

how can i automate logging in when i'm writing little shell scripts?  specifically, some examples would be to su to root, enter the root pwd and then do a find command on the whole filesystem.  another would be to run a vncviewer with a certain ip, and pipe in the password automatically.  

eg  #!/bin/sh
      "pipe in password here for the vncauth window"

i know, i know.  this is dangerous, but i'm only going to do these types of things locally, behind a firewall
Back to top
Profile PM 
SaidinUnleashed Offline

Group: Members
Posts: 1428
Joined: Mar. 2004
Posted: Aug. 24 2005,01:40 QUOTE

Code Sample
dsl@box:~$ vncviewer --help
VNC viewer version 3.3.7 - built Nov 16 2003 08:08:33
Copyright (C) 2002-2003 RealVNC Ltd.
Copyright (C) 1994-2000 AT&T Laboratories Cambridge.
See for information on VNC.

usage: vncviewer [<options>] <host>:<display#>
      vncviewer [<options>] -listen [<display#>]

<options> are standard Xt options, or:
             -passwd <passwd-file>
             -encodings <encoding-list> (e.g. "raw copyrect")
             -depth <depth>

Please try to use the --help flag for a program before asking questions about run-time options, it usually has the info you need.


They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, cause if you play it forwards, it installs Windows.

Unleash the power of the TILDE~~~
Back to top
mikshaw Offline

Group: Members
Posts: 4856
Joined: July 2004
Posted: Aug. 24 2005,01:50 QUOTE

added for future reference....
some programs use "-help" or "-h" instead of "--help".

Back to top
Profile PM WEB 
cbagger01 Offline

Group: Members
Posts: 4264
Joined: Oct. 2003
Posted: Aug. 24 2005,16:06 QUOTE

While we are on the subject, another way to get information is to search google for the man page of the program. In other words, search keywords like:

man vncviewer

My personal favorite for man pages is a site called, so you can search via this syntax:

man vncviewer
Back to top
Profile PM 
Grim Offline

Group: Members
Posts: 284
Joined: Mar. 2004
Posted: Sep. 09 2005,23:53 QUOTE

You're looking for `expect'.  Most people don't use expect anymore but, it used to be real handy for use with minicom to dial-up to your isp.

There's a bit of a learning curve (say ten to fifteen minutes) but you can automate a whole bunch of stuff with it.

I don't have a url for documentation, but a quick google should find some stuff.

No good deed goes unpunished...
Back to top
Profile PM WEB 
4 replies since Aug. 23 2005,22:40 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Quick Reply: shell script question

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code