'My script file stopped executing when there change in user in script what should i do

My code file looks as follows

     Cd testR
     Mkdir bin
     chmod -R 755 bin
     Sudo su - inst1 
     cp inst1/installable/files/testR.p
     ...
     ...

So after sudo su the execution get paused please let me know what should i do



Solution 1:[1]

If there is no problem that your commands are executing as root, you can execute your script like this: sudo ./yourscript

So, you don't have to switch within your shell script.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alexis Ruiz