If I call a bash script with
sudo, for example:
sudo bash script.sh
Do I still have to use
sudo inside the script in cases like this:
sudo apt-get update
No. the command will be run with root privileges and all commands that the script runs will inherit the privileges.
no, by calling sudo you are running a process in kernal mode which means you have access to everything, you no longer have to use special permissions in different areas of your code/script.