Opensuse

zypper:如何列出所有活動的包回購?

  • April 25, 2019

如何顯示所有活動的包回購zypper

我需要檢查腳本的輸出。

我知道如何將它們全部列出。但我想避免用正則表達式解析這個輸出:

foo-work:~ # LANG=C zypper lr
# | Alias                             | Name                          | Enabled | Refresh
--+-----------------------------------+-----------------------------------+---------+--------
1 | openSUSE 12.3 FOO-BAR           | openSUSE 12.3 FOO-BAR           | Yes     | Yes    
2 | openSUSE 12.3 FOO-BAR Test      | openSUSE 12.3 FOO-BAR Test      | Yes     | No     
3 | openSUSE-12.3 Updates (FOO-BAR) | openSUSE-12.3 Updates (FOO-BAR) | Yes     | Yes    
4 | openSUSE-12.3-Non-Oss (FOO-BAR) | openSUSE-12.3-Non-Oss (FOO-BAR) | Yes     | No     
5 | openSUSE-12.3-Oss (FOO-BAR)     | openSUSE-12.3-Oss (FOO-BAR)     | Yes     | No     

您是在尋找-E, --show-enabled-only僅顯示啟用的儲存庫的標誌,還是尋找-e -,--export -以獲取儲存庫定義格式的列表,以便更輕鬆地解析?

zypper lr -E -e - |grep name=

引用自:https://serverfault.com/questions/964565