I have a script with multiple functions
vis
function definition1() ...
function definition2() ...
function definition3()...
#When I invoke the script I would like to have
definition1
sudo definition2
definition 3
exit 0
From what I have read, because I want definition2 to be invoked via sudo, I should make it a stand alone script. But I really would like it to remain in this script because of defined variables and functions.
Is it possible for a standard (non root owned script) to do some work with root's libraries if the script is run by an administrator ?