Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing to su in a script

Status
Not open for further replies.

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?
 
spawn su -

expect "password";

send "passwd\n"

expect "*#";

interact =-=-=-=-=-=-=-=-=-=-=-=
Unix Systems Engineer
=-=-=-=-=-=-=-=-=-=-=-=
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top