From ohcanada, 4 Months ago, written in Bash.
  1. # assume $missing contains a list of missing packages
  2. # all package names are 'safe'
  3.  
  4. # don't try with empty list
  5. if [[ "$missing" ]]; then
  6.   myecho Installing $(echo "$missing" | wc -l) 'missing package(s) :'
  7.   echo
  8.   echo $missing
  9.   echo
  10.   apt-get -y install $missing
  11. else
  12.   myecho No missing packages
  13. fi
captcha