I'm trying to loop through all of the repositories on our satellite servers and list the number of rpms in each. I need the repository ID and NAME which I can get from
hammer --csv repository list | grep -v 'Id,Name' | cut -d, -f1,2`
Given ID and NAME, I can get the number of packages and print out:
SUM=$(hammer repository info --id ${ID} | grep Packages | awk '{ print $2 }');
echo "In repository, ${NAME}, there are ${SUM} packages."
I just can't figure out how to put that in a loop. Any suggestions?
while read sum nameloop.