sudo before a command affects only that one command whether you do it manually or inside a script, so I don't quite understand what do you mean.
Your script would look like (with my comments in red)
Code:
#!/bin/sh
sudo rm -r -f /lib/modules/$(uname -r)/kernel/drivers/media # I suppose you know what you're doing
cd ~/Downloads/tbs-linux-drivers_v140113/linux-tbs-drivers
make clean # no need to be root for this
make distclean # neither for this one
./v4l/tbs-x86_64 # nor for this one
make -j5
sudo make install
sudo modprobe -v tbs62x0fe
You run this script as normal user. When executing the first command that is prefixed with sudo it will ask your for password. Then each further command in the script prefixed with sudo will be executed with root privileges.
Bookmarks