3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

fish $PATHの設定方法がわからん

Last updated at Posted at 2022-01-17

環境構築した際、これで躓いたのでメモついでに書きます

zsh bash etc 
export PATH=$HOME/hoge:$PATH

で環境変数に設定できると思うのですが、
fishで同じ書き方をすると、、、
echo $PATH

/usr/local/bin /usr/bin /bin /usr/sbin /sbin

はい。うざいですね。

そんな時はdocumentを見に行きましょ

時間ない人へ

set PATH $HOME/hoge /usr/local/bin /usr/sbin $PATH

が正解らしい

なんだこの書き方は、、、
初めて見た時ビビりました

複数設定したい場合はどういう風に書けばいいのか、、

そんな時はdocumentをみにいきましょー

どうやらPATHをリストで扱えるらしいです

for val in $PATH
    echo "entry: $val"
end

結果
entry: /usr/bin/
entry: /bin
entry: /usr/sbin
entry: /sbin
entry: /usr/local/bin

スクリプト組みたい方にしたら便利かもしれないですね!

そんなわけで解決解決〜〜

よきfishライフを!!

3
0
0

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
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?