Looping through arrays in Bash
Create an array with the following syntax.
packages=(curl git wget vim)
You can simply loop through it with a for-loop.
for program in "${apt_programs[@]}"; do
sudo apt-get install ${program}
done
Create an array with the following syntax.
packages=(curl git wget vim)
You can simply loop through it with a for-loop.
for program in "${apt_programs[@]}"; do
sudo apt-get install ${program}
done