Issue
I do understand the following script is installing the packages but what I don't understand is what packages:
for package in ${d[@]};
do
rpm -ivh --quiet ${!package} >/dev/null 2>&1
What is ${d[@]}
?
Solution
In this case 'd' is a name of an array. the '@' in the square brackets means 'each element of the array individually'.
So 'for' loops over each package listed in the array.
About the ${!package}
(taken from the bash manual man bash
section 'EXPANSION'):
If the first character of parameter is an exclamation point (!), a level of variable indirection is introduced. Bash uses the value of the variable formed from the rest of parameter as the name of the variable; this variable is then expanded and that value is used in the rest of the substitution, rather than the value of parameter itself. This is known as indirect expansion.
As you did not post the full script i cannot really see how this works.
Answered By - Bruh