Click to See Complete Forum and Search --> : su in Bash Script?


MrMoray
12-03-2003, 08:17 AM
Hey gang, I'm writing a simple script to help me out with something and in certain parts of it I need to switch to root. I can't figure out how to pass the root password in the script. Can someone shed some light on this for me? The script stops, with the password prompt on the screen, which obviously I can type manually at that point, but I don't want to do that...how do I get that in the script?

TIA,
Mike

Hayl
12-03-2003, 08:34 AM
use sudo

bwkaz
12-03-2003, 07:56 PM
Or expect / autoexpect.