Chapter 8 - YUM - script to list status of repositories
I guess I'm bored. "Chapter 8 - What is YUM" talks about the repository files in /etc/yum.repos.d. In my Centos VM there are quite a number of them. As it turns out, some of these repository files contain definitions for multiple repos.
Instead of printing each one and check for enabled=1, I wrote this little one-liner that lets you know which repositories are enabled:
for i in /etc/yum.repos.d/*; do echo "$i: "; cat $i | grep -e "\[" -e enabled= ; done
Hope it's useful.