dimanche 30 novembre 2014

apt-get fails to continue running in a loop after one failed install in bash


Vote count:

0




I am trying to create a bash script that will automatically install stuff using apt-get. I am using the following methods for the installation:


Method 1


Install(){ for TempVar in "$1" do eval 'sudo apt-get install '$TempVar done }


Method 2


Install(){ eval 'sudo apt-get install '$TempVar }


for TempVar in "$1" do Install '(insert programs here separated by spaces)' done


In both cases when something failed to install apt-get refused to install anything else. Naturally, apt-get functioned normally in the same script after the for loop ended. I am under the impression that apt-get retains its error status until the loop it was executed in is fully terminated. Is there a way to get around this?



asked 1 min ago







apt-get fails to continue running in a loop after one failed install in bash

Aucun commentaire:

Enregistrer un commentaire