I'm setting up a new machine (well actually, an Ubuntu VM) and am trying to write a script to setup a few common things that I use when doing this (Git, curl, vim + janus).
So my script looks a bit like this:
#setup
#!/bin/sh
sudo apt-get install git
sudo apt-get install curl
...
It doesn't seem great to have 'sudo' mixed in with my command -- that is just my security-spidey-sense tingling. It seems like something like the following might also work:
sudo setup
Is there a better way to do this? What are your rules of thumb when you write scripts and need elevated permissions?