Feb 26, 2003 #1 tbohon Programmer Apr 20, 2000 293 US In a BASH script, how do I change to su to perform maintenance and get the root's password to automatically echo to the script?
In a BASH script, how do I change to su to perform maintenance and get the root's password to automatically echo to the script?
Feb 26, 2003 #2 marsd IS-IT--Management Apr 25, 2001 2,218 US You don't. try expect: http://expect.nist.gov Upvote 0 Downvote
Mar 3, 2003 #3 sco21 Technical User May 20, 2002 67 GR spawn su - expect "password"; send "passwd\n" expect "*#"; interact =-=-=-=-=-=-=-=-=-=-=-= Unix Systems Engineer =-=-=-=-=-=-=-=-=-=-=-= Upvote 0 Downvote
spawn su - expect "password"; send "passwd\n" expect "*#"; interact =-=-=-=-=-=-=-=-=-=-=-= Unix Systems Engineer =-=-=-=-=-=-=-=-=-=-=-=