by shigemk2

当面は技術的なことしか書かない

fish

fish shell 2.7.0

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 commands

fish特有のコマンドはこいつらだけのはず。ドキュメント色々見たので。 fish: Commands

fish shellのコマンドマニュアルでコマンド名が二度表示されるのを直したい

直したプルリク 取り込まれるかどうかは知らない。 github.com 概要 fish shellで、abbr --help とか man abbr を実行すると、以下のような結果が得られる。 abbrabbr - manage fish abbreviations - Synopsis abbr --add [SCOPE] WORD EXPANSION abbr --era…

hub alias -s fish

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

fish shell doc_src doc_srcの下のファイルってどうするんだろうって思ったけど、manやdocumentで使われていた。 fish-shell/abbr.txt at master · fish-shell/fish-shell · GitHub

fish argparse not found

aptで入れたfish shell、argparse使えなくないか???2.6.0だけど— shigemk2 (@shigemk2) November 1, 2017 これ。 github.com apt-getで入れられる現行のfishだと2.6.0が入るけど、それだとそもそもargparseが実行できないし、ここのIssueでfixされたコミ…

Tests disabled: expect not found fish shell

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

fish shell contribute 使用しているプログラミング言語はC++ Include What You Useがキモのひとつ ドキュメントのソースはdoc_srcだけど、実際のサイトとどのように紐付いているか不明 abbrとか 当然だけどテストやLintはパスしてね

fish switch

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 funcsave 関数保存

fish shell binding

fish shell binding bind bindの関数リストなど https://fishshell.com/docs/current/commands.html

fish psub etc

fish psub etc プロセス置換 (command | psub) 名前付きパイプ (コマンド間でデータを渡す。パラメータとは別。故にsource (command) みたいなのはエラーになる) コマンド置換 (command) コマンドラインのパラメータ展開 パイプライン 複数のコマンドをひと…

fish shell too many arguments

fish shell too many arguments 例のアレ。 status --is-interactive; and . (rbenv init -|psub) 最近のfish shellでは.はNGになっててsourceに変えられる。 rbenvを最新までアップデート(git pull)したらエラーは消えた。 [http://blog.tokoyax.com/entry/…

type . in fish

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…

convert bash to fish

このあたりとかを参考に。 stackoverflow.com

unalias fish

fishにunaliasコマンドはない。aliasを外すには、 functions -e xxxxxxxx こう。 Unix Shells: Bash, Fish, Ksh, Tcsh, Zsh - Hyperpolyglot

fish /etc/profile

Fish is not a POSIX 1003.1 compatible shell. It does not read /etc/profile 要するに、/etc/profileは読めない。ので、proxy設定をごにょりたいときは/etc/environmentに設定を追加した。 github.com

fish shell random

fish random zsh/bashのように$RANDOM変数ではなく、randomという関数が用意されている。

unset fish

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

reload fish config source ~/.config/fish/config.fish もうつかえないやつ(older than 2.1) . .config/fish/config.fish

fish shell one-liner for

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…

for loop fish shell

なんかzshとか比べてすごい直感的になっている (seq 5)って書けば1 to 5でループできる。 for x in (seq 5); echo $x; end fish: Tutorial

rbenvとbundler(fish)

rbenv init - | source ちゃんと入れよう。挙動がおかしくなる。少なくとも、自分の場合はbundlerがシステムのほうになっていた。 www.qoosky.io

fish shell japanese document

例のやつ。レファレンス的に読む fish.rubikitch.com

fish pipeline

パイプライン fish.rubikitch.com

fish shell documentation

exec replaces the currently running shell with a new command. On successful completion, exec never returns. exec cannot be used inside a pipeline. どうしようか。 fish user documentation

golang ubuntu

なぞると良い。なお、fishではset -xを使うとgo envの設定を上書きできる(-xをつけないと上書き出来ない) Ubuntu · golang/go Wiki · GitHub

pecoでgit checkoutしたい fish-shellで

はてな記法でfishは使えない。 function peco-git-checkout git branch -a | peco | tr -d ' ' | read branch echo $branch if [ $branch ] if contains $branch "remotes/" set -l b (echo $branch | awk -F'/' '{print $3}') git checkout -b $b $branch e…

fish shell not contain

こういうの。NOT条件で文字列が含まれているかどうかをnot containsで調べることが出来る。 for i in ~/bin /usr/local/bin if not contains $i $PATH set PATH $PATH $i end end fish user documentation

fish shell install

github.com yumじゃ最新のは入らない。入らない。ので、make。 autoreconf --no-recursive [if building from Git] ./configure make [gmake on BSD] sudo make install