Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to know the meaning of compgen options. With help compgen I can get help page. But it shows only the option lists. There is no explanation for it.

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.

Especially I want know how -abcdefgjksuv arguments works.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Near the bottom of the bash man page is the section SHELL BUILTIN COMMANDS where it says

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 stan-
          dard output.  When using the -F or -C options,  the  various  shell
          variables  set  by  the  programmable  completion facilities, while
          available, will not have useful values.

          The matches will be generated in  the  same  way  as  if  the  pro-
          grammable  completion  code had generated them directly from a com-
          pletion specification with the same flags.  If word  is  specified,
          only those completions matching word will be displayed.

          The  return  value is true unless an invalid option is supplied, or
          no matches were generated.

Just below it is the complete builtin command which explains the switches.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.