LoginSignup
2
2

More than 5 years have passed since last update.

zsh global alias でエラー出力だけを楽々パイプする

Posted at
.zshenv
alias -g L="|& $PAGER"
alias -g E='2>&1 > /dev/null'

-g は global alias にするオプション。こうしておくと、例えば次のように書くことができるようになる:

$ g++ hoge.cpp E L
(エラー出力をページャで見る)

今の場合、下のと同じ意味になります:

$ g++ hoge.cpp 2>&1 > /dev/null |& lv

「へいへい、もっと cool な方法があるぜ!」って人はツッコミ入れてくださいな。

2
2
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2