Bash script execution
Hey Folks,
I need to create a bash script that will launch 3 separate commands one after the other. I have decided to put in a sleep command between them so that it waits for a certain amount of time(since I am not 100% sure commands can be executed simultaneously or all at once). The output of command1 requires some time to process.So does the output of command2 and command3.
Do you consider this appropriate :
#!/bin/bash
cd /usr/sbin
command1(which performs analysis)
*here it asks for credentials*
Then it executes the command.
sleep (say 100 just in case )
command2(performs staging)
*here it asks for credentials*
sleep 100
command3(performs install)
*here again asks for creds*
Perhaps I can implement the username/pass as a variable.
VARIABLE1=username
VARIABLE2=password
Please let me know if you have any suggestions.
|