shell script question
Forum: water cooler
Topic: shell script question
started by: kagrecu
Posted by kagrecu on Aug. 23 2005,22:40how 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.
"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
Posted by SaidinUnleashed on Aug. 24 2005,01:40
Please try to use the --help flag for a program before asking questions about run-time options, it usually has the info you need.
Posted by mikshaw on Aug. 24 2005,01:50added for future reference....
some programs use "-help" or "-h" instead of "--help".
Posted by cbagger01 on Aug. 24 2005,16:06While 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:
My personal favorite for man pages is a site called die.net, so you can search via this syntax:
man vncviewer site:die.net
Posted by Grim on Sep. 09 2005,23:53You'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.