Using Expect script I am trying to automate execution of 2 different scripts run by 2 different users on same server. Script 1 needs to be run by user 1 Script 2 needs to be run by user 2. The workflow of these scripts is: Script 1 is executed as user 1. During execution it creates Script 2 and halts for input. At this stage it asks to execute script2 as user 2 and once complete. Script 1 will resume when return key is pressed. The problem I am facing is when Script 1 halts and waits for input i don't know how to execute script2 as user2 and then resume script 1. I really need some help on this. I am very new to scripting.
If you script uses the 'sudo' command to execute script2 it just needs to wait until the sudo command terminates (in other words, the instruction after the sudo will be executed after script2 exits). This may require a bit of setup of sudoers.
View Tag Cloud
Ubuntu Forums Code of Conduct