0
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 3 years have passed since last update.

fishでの変数扱い方

Posted at

はじめに

去年から、fishに切り替えたのですが、変数の扱いがなかなか慣れないので、まとめておきます。

変数の定義・使い方

# 変数の定義
$ set key value
# 変数は$を先頭につける
$ echo $key
# 変数展開その1 変数を{}で括る
$ echo {$key}test
# 変数展開その2 変数以外を""で括る
$ echo $key"test"
# グローバル変数として定義(すべてのfishセッションで共有)
$ set -U global_key globa_val
# eオプション( --erase or -e)で削除
$ set -e global_key

参考

fish公式ページ

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