Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!news.kei.com!bloom-beacon.mit.edu!boulder!emu.fsl.noaa.gov!kelly From: kelly@emu.fsl.noaa.gov (Sean Kelly) Newsgroups: comp.unix.bsd.freebsd.misc Subject: Re: How would you do this ? Date: 20 Aug 1995 15:30:42 GMT Organization: Forecast Systems Laboratory Lines: 25 Message-ID: <417kf2$ivt@CUBoulder.Colorado.EDU> References: <aak2.808401125@ra.msstate.edu> <40nr0b$jo9@gate.sinica.edu.tw> <aak2.808433446@Ra.MsState.Edu> <jcaron-1508950230180001@mon2-02.planete.net> NNTP-Posting-Host: emu.fsl.noaa.gov In article <jcaron-1508950230180001@mon2-02.planete.net>, Jacques Caron <jcaron@pressimage.net> wrote: >Depends a lot on how it is done. If it is done somewhat properly (a la >login/su), there's no way you can automate it (it resets stdin/out to the >tty). But then "expect" could do it: ------------------------------------------------------------------------ #!/usr/local/bin/expect spawn start_my_program expect "security password" ;# Wait for password prompt send "#ja7%ka1" ;# Send the secret password interact ;# Let it run ------------------------------------------------------------------------ Put that in a file, make it exectuable, and call the script from /etc/rc.local. Oh, and don't forget to install expect. -- Sean Kelly NOAA Forecast Systems Lab, Boulder Colorado USA One night I came home very late. It was the next night. -- Steven Wright