I have a script that executes three functions: A && B && C
.
Function B
needs to be run as a super-user, while A
and C
don't.
I have several solutions but neither of these are satisfying:
sudo the entire script: sudo 'A && B && C'
That seems like a bad idea to run A
and C
as super-user if it's not
needed
make the script interactive: A && sudo B && C
I might have to type-in …