I have a script that , among other things, needs to do some stuff as root, like creating a mount folder. I tried:
echo "Linux user password is needed in order to ..."
sudo -s
# also tried:
# sudo su
... code that requires root permission
exit
... code that requires user permission
The problem is that the script stops after the "sudo -s" and continues only after I manually exit the automatically created root shell.
Is there a way to run root shell commands within a user script?
Thanks.
sudo
from the first script. – forcefsck Oct 18 '11 at 20:53