On Linux, how can I enter a password for one of the commands in the command chain that requires sudo. One example that I can think of is that after doing a long compilation job I want to turn off the machine.
make ; sudo init 0
I want the shutdown command to start only after the finish is complete, but I would like to enter the password immediately, because I will not be there when the first command is executed. In addition, I do not want to run make with superuser privileges. Therefore, switching to root and running commands is also out of the question.
Thank!
Rohit source
share