fish
printfの使い方復習 $ for x in (seq 10); printf '%02d\n' $x; end 01 02 03 04 05 06 07 08 09 10 fish: Commands
toいるかとおもったらtoいらない for x in (seq 5 10) echo $x end fish shellチュートリアル How to iterate for loop with limiting sequence in fish shell - Stack Overflow
$ echo (math 'a=10 ; (a * 70) / 100') こういうことしようとすると、こんなエラーになるので、おとなしく変数にいれてやってから計算したほうがいい $ echo (math '(echo 7) * 70 / 100') (standard_in) 1: parse error math:bcを召喚して強力数値計算!ex…
memo fish loop one-liner for x in (seq 5) touch file_$x.txt end こう書けば良いことを忘れていた for x in (seq 12); random; end https://fishshell.com/docs/current/tutorial.html#tut_loops
set -xg # Prints all global, exported variables. g グローバル x 環境変数 export sh/bash setenv tcsh/csh fish: Commands github.com
www.shigemk2.com コピーのテスト。 直したプルリク 取り込まれるかどうかは知らない→取り込まれた。 github.com 概要 fish shellで、abbr --help とか man abbr を実行すると、以下のような結果が得られる。 abbrabbr - manage fish abbreviations - Synops…
fish shell 2.7.0 There are no major changes between 2.7b1 and 2.7.0. If you are upgrading from version 2.6.0 or before, please also review the release notes for 2.7b1 (included below). 2.7b1と違いはそんなにない いくつかのauto completion追…
fish特有のコマンドはこいつらだけのはず。ドキュメント色々見たので。 fish: Commands
直したプルリク 取り込まれるかどうかは知らない。 github.com 概要 fish shellで、abbr --help とか man abbr を実行すると、以下のような結果が得られる。 abbrabbr - manage fish abbreviations - Synopsis abbr --add [SCOPE] WORD EXPANSION abbr --era…
hub alias -s fish 以前はeval (hub alias -s)でもOKだったのに、最近になってNGになった alias git=hub # eval (hub alias -s) hub alias -sで-sオプションをつけると単にaliasになるけど、つけないとfunctionになる。 hub/alias.go at master · github/hub…
fish shell doc_src doc_srcの下のファイルってどうするんだろうって思ったけど、manやdocumentで使われていた。 fish-shell/abbr.txt at master · fish-shell/fish-shell · GitHub
aptで入れたfish shell、argparse使えなくないか???2.6.0だけど— shigemk2 (@shigemk2) November 1, 2017 これ。 github.com apt-getで入れられる現行のfishだと2.6.0が入るけど、それだとそもそもargparseが実行できないし、ここのIssueでfixされたコミ…
fish shellのmake testでTests disabled: expect not foundなどというエラーに見舞われたのでexpectを入れたら解決— shigemk2 (@shigemk2) November 1, 2017 fish shellでmake testしたらばexpectがないってんで怒られたので、sudo apt-get install expectで…
fish shell contribute 使用しているプログラミング言語はC++ Include What You Useがキモのひとつ ドキュメントのソースはdoc_srcだけど、実際のサイトとどのように紐付いているか不明 abbrとか 当然だけどテストやLintはパスしてね
fish switch switchを使える。というか使わないといけない switch (uname) case Linux echo Hi Tux! case Darwin echo Hi Hexley! case FreeBSD NetBSD DragonFly echo Hi Beastie! case '*' echo Hi, stranger! end
fish shell funcsave 関数保存
fish shell binding bind bindの関数リストなど https://fishshell.com/docs/current/commands.html
fish psub etc プロセス置換 (command | psub) 名前付きパイプ (コマンド間でデータを渡す。パラメータとは別。故にsource (command) みたいなのはエラーになる) コマンド置換 (command) コマンドラインのパラメータ展開 パイプライン 複数のコマンドをひと…
fish shell too many arguments 例のアレ。 status --is-interactive; and . (rbenv init -|psub) 最近のfish shellでは.はNGになっててsourceに変えられる。 rbenvを最新までアップデート(git pull)したらエラーは消えた。 [http://blog.tokoyax.com/entry/…
sourceのaliasのようなかんじ。 type . . is a function with definition # Defined in /usr/share/fish/config.fish @ line 215 function . --description 'Evaluate contents of file (deprecated, see "source")' --no-scope-shadowing if begin test (co…
このあたりとかを参考に。 stackoverflow.com
fishにunaliasコマンドはない。aliasを外すには、 functions -e xxxxxxxx こう。 Unix Shells: Bash, Fish, Ksh, Tcsh, Zsh - Hyperpolyglot
Fish is not a POSIX 1003.1 compatible shell. It does not read /etc/profile 要するに、/etc/profileは読めない。ので、proxy設定をごにょりたいときは/etc/environmentに設定を追加した。 github.com
fish random zsh/bashのように$RANDOM変数ではなく、randomという関数が用意されている。
zshやbashでいうところのunsetってfishだとどうやるんだい。 こうやる。 set -e myvar # or set --erase myvar いい加減覚えたい。 How do I unset a variable in the fish shell? - Stack Overflow
reload fish config source ~/.config/fish/config.fish もうつかえないやつ(older than 2.1) . .config/fish/config.fish
for x in (seq 5); uuidgen >> (date +"%Y%m%d".csv); end こういうふうに書く。なお、;を省くと、以下のようなエラーに見舞われる。 for x in (seq 5) uuidgen >> (date +"%Y%m%d".csv) end Expected end of the statement, but instead found a redirectio…
なんかzshとか比べてすごい直感的になっている (seq 5)って書けば1 to 5でループできる。 for x in (seq 5); echo $x; end fish: Tutorial
rbenv init - | source ちゃんと入れよう。挙動がおかしくなる。少なくとも、自分の場合はbundlerがシステムのほうになっていた。 www.qoosky.io
例のやつ。レファレンス的に読む fish.rubikitch.com