![](/img/trans.png)
[英]How can I make Bash automatically pipe the output of every command to something like tee?
[英]Append | tee ~/.output to every bash command
我該如何追加| tee ~/.output
| tee ~/.output
到每個單獨的bash命令?
我想輸出最后一條命令的結果,以便可以在$ variable中使用它們。
我想在每個bash命令后附加一個字符串,方法是重新綁定enter
鍵以添加命令字符串。 或者,如果您願意創建輔助回車鍵並使用它。
您應該執行以下操作:
bind 'RETURN: " | tee ~/.output \n"'
這樣,每次你按enter
的| tee ~/.output
| tee ~/.output
被附加。
這是僅限bash
解決方案。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.