Linux - Bash - Get $releasever and $basearch values?
问题 I'm writing a bash script to pull packages from remote repos, using reposync, so I can point my nodes to pull locally. As such I am trying to keep the local repo configs as similar as possible to the usptream repo configs, like this: # upstream baseurl=http://mirror.freedomvoice.com/centos/$releasever/os/$basearch/ # local baseurl=http://user:password@repo.example.com/centos/stable/$releasever/os/$basearch/ Within the bash script, is there a cleaner way to get $releasever and $basearch values