View Single Post
Old 08-11-2007   #5 (permalink)
yaaarrrgg
Super Moderator
 
yaaarrrgg's Avatar
 
Join Date: May 2007
Location: Indiana, USA
Posts: 973
Default Re: Enter a password automatically w/ bash script?

for complex interactive tools, the "expect" tool is probably the most powerful.

Otherwise for simple scripts you can do something like:

sudo umount /media/disk << eob
YOURPASSWORD
eob


(the eob just marks a "here" document ... can be any unique string)
yaaarrrgg is online now   Reply With Quote