ハッシュコマンド文書はどこにありますか?

ハッシュコマンド文書はどこにありますか?

私が入力している間にman hash表示されますman builtin

私はこの行を理解しようとしています。

hash -r 2>/dev/null || true

すべきことhash -rと返す項目。

コンテキスト:

export PATH="$PWD/bin:$PATH"
hash -r 2>/dev/null || true

https://github.com/rbenv/rbenv/wiki/Understanding-binstubs#adding-project-specific-binstubs-to-path

ベストアンサー1

hashシェルが組み込まれています。

を使用している場合は、次の点を確認してbashください。

help hash

あなたの便宜のために:

ハッシュ:ハッシュ[-lr] [-pパス名] [-dt] [名前...]

Remember or display program locations.

Determine and remember the full pathname of each command NAME.  If
no arguments are given, information about remembered commands is displayed.

Options:
  -d                forget the remembered location of each NAME
  -l                display in a format that may be reused as input
  -p pathname       use PATHNAME as the full pathname of NAME
  -r                forget all remembered locations
  -t                print the remembered location of each NAME, preceding
            each location with the corresponding NAME if multiple
            NAMEs are given
Arguments:
  NAME              Each NAME is searched for in $PATH and added to the list
            of remembered commands.

Exit Status:
Returns success unless NAME is not found or an invalid option is given.

他のシェルの場合は、組み込み機能の共通位置を確認してください。たとえば、zsh次のことを確認してください。

man zshbuiltins

hash -r が実行するアクションと返されるアクション

hash -rハッシュテーブルから記憶されているすべての場所を削除し、成功を返します。

おすすめ記事