"compgen" 組み込みコマンドの詳細

からhelp compgen

$ help compgen
compgen: compgen [-abcdefgjksuv] [-o option]  [-A action] [-G globpat] [-W wordlist]  [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]
    Display possible completions depending on the options.
    
    Intended to be used from within a shell function generating possible
    completions.  If the optional WORD argument is supplied, matches against
    WORD are generated.
    
    Exit Status:
    Returns success unless an invalid option is supplied or an error occurs.

オプションは何を[-abcdefgjksuv]表していますか?

つまり、すべてのオプションの使い方を知りたいのです。

ベストアンサー1

コマンドオプションはおよびを除いてとcompgen同じです。マニュアルページから:complete-p-rcompgen

compgen
 compgen [option] [word]
 Generate possible completion matches for word according to the options, which 
 may be any option accepted by the complete builtin with the exception of -p 
 and -r, and write the matches to the standard output

オプションの場合[abcdefgjksuv]:

  • -aエイリアスを表す名前
  • -bシェル組み込み関数の名前を示します。
  • -cすべてのコマンドの名前を示します。
  • -dディレクトリ名を示します。
  • -eエクスポートされたシェル変数の名前を示します。
  • -fファイル名を示します。
  • -gグループの名前を示します。
  • -j役職を表します。
  • -kシェル予約語の名前を示します。
  • -sサービス名を示します。
  • -uユーザー名を表す名前
  • -vシェル変数の名前を表します。

完全なマニュアルページを見ることができますここ

おすすめ記事