I often write up wiki instructions to install various server packages on Ubuntu (11.10 Oneiric at the moment). They always involve things like:
sudo apt-get install -y postfix
sudo cp ~/siteconfig/etc/postfix/main.cf /etc/postfix
but when you cut and paste this to a terminal, either sudo, apt-get, or some subshell randomly swallows the subsequent lines of input, and only the
apt-get install happens.
Is there a way to make this more cut-and-paste-friendly? I suppose I could wrap each section with
cat > script <<EOF
apt-get install -y postfix
cp ~/siteconfig/etc/postfix/main.cf /etc/postfix
sudo sh ./script
but is there a better way?