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 permissionexit... code that requires user permissionThe 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.
Run in root shell from within a user bash script
bash;shell;sudo