やはりbashとは色々と違うようだ

bashの場合

 

fishの場合

 

Wildcards

If a star (*) or a question mark (?) is present in the parameter, fish attempts to match the given parameter to any files in such a way that:

  • ? can match any single character except ‘/’.
  • * can match any string of characters not containing ‘/’. This includes matching an empty string.
  • ** matches any string of characters. This includes matching an empty string. The matched string may include the / character; that is, it recurses into subdirectories. Note that augmenting this wildcard with other strings will not match files in the current working directory ($PWD) if you separate the strings with a slash (“/”). This is unlike other shells such as zsh. For example, **\/*.fish in zsh will match .fish files in the PWD but in fish will only match such files in a subdirectory. In fish you should type ***.fish to match files in the PWD as well as subdirectories.

cf. Glob matching (wildcards) in fish shell not matching bash behavior
https://stackoverflow.com/questions/28838665/glob-matching-wildcards-in-fish-shell-not-matching-bash-behavior

cf. fish: Documentation
https://fishshell.com/docs/current/index.html

cf. Linux【ワイルドカードと正規表現】の違い, 展開の動作 ~ls, grep, findでの具体例の解説~
https://milestone-of-se.nesuke.com/sv-basic/linux-basic/wildcard-regular-expression

カテゴリー: 技術

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です