[英]How to indent output of git-clone
我一直在嘗試縮進 git 克隆的 output 。 我嘗試使用 sed 但它不起作用......這是我迄今為止嘗試過的。
git clone https://github.com/test/HelloWorld --progress | sed 's/^/ /g'
有沒有人有任何想法?
Git 輸出到標准輸出和標准錯誤。 要過濾兩者,您可以使用|&
或2&1 |
.
它還打印使用\r
回車更新的進度行。 除了普通行之外,您還可以使用正則表達式來縮進這些行。 我還將使用-u
進行無緩沖輸入和 output。
git clone https://github.com/test/HelloWorld --progress blah |&
sed -ur 's/(^|\r)/\1 /g'
一旦我找到pr
:
git clone https://github.com/test/HelloWorld --progress 2>&1 | pr -tro 3
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.