How do I “replay” the “Caveats” section from a homebrew recipe

前端 未结 5 614
抹茶落季
抹茶落季 2020-12-12 21:51

When installing a homebrew recipe, you occasionally will get some useful information in the \"Caveats\" section that you may want to tuck under your hat. Is there any way to

5条回答
  •  时光说笑
    2020-12-12 22:30

    Another possibility is to use sed

    brew info $(brew list) | sed '/==> Caveats/,/==>/!d;//d'
    

    And to have a formatted output (bash)

    for cmd in $(brew list); do 
      if brew info $cmd | grep -q Caveats; then
        echo "$cmd\n"; 
        brew info $cmd | sed '/==> Caveats/,/==>/!d;//d'; 
        printf '%40s\n' | tr ' ' -; 
      fi; 
    done;
    

提交回复
热议问题