LoginSignup
1
1

More than 5 years have passed since last update.

Fish Shell で、コマンド結果を出力したくない、 (zshの 2>&1 >/dev/null) をしたい場合

Last updated at Posted at 2017-03-29

試行錯誤の末、愚直な解しか得られなかった。

fish
~> git rev-parse --git-dir ^/dev/null >/dev/null

背景

現在のディレクトリがGitリポジトリ配下かどうかを判定したかったので、

zsh
% git rev-parse --git-dir 2>&1 >/dev/null

がしたかったのだが、

fish
~> git rev-parse --git-dir 2>&1 >/dev/null
~> git rev-parse --git-dir ^> /dev/null
~> git rev-parse --git-dir >| cat > /dev/null

は全部駄目だった。

もっとエレガントな方法があれば教えてほしい。

参考 https://github.com/fish-shell/fish-shell/issues/110

1
1
2

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
1
1