fugafuga.write

日々のログ

fish shell で xargs -J するときの注意点

カレントディレクトリの全てをディレクトリpにまとめたかった。

これでは動かない

> find . -type d ! -name 'p' | grep './' | xargs -J % mv % p/

これで動く

> find . -type d ! -name 'p' | grep './' | xargs -J \% mv \% p/

fish shell では %{}は特別扱いになるらしい

(参考)

Why does xargs under fish not accept {} as a replstr like it does with bash? ... | Hacker News