
complete | 657
Bash and Korn
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
Example
Create an alias for rm that will get the system’s version, and run it
with the -i option:
$ alias 'rm=command -p rm -i'
compgen
compgen [options] [string]
Bash only. Generate possible completions for string according to
the options. Options are those accepted by complete, except for -p
and -r. For more information, see the entry for complete.
complete
complete [options] command ...
Bash only. Specify the way to complete arguments for each
command. This is discussed in “Programmable Completion (Bash
only),” earlier in the chapter.
Options
-a Same as -A alias.
-A type
Use type to specify a list of possible completions. The type may
be one of the following.
alias
Alias names.
arrayvar
Array variable names.
binding
Bindings from the readline library.
builtin
Shell built-in command names.
directory
Directory names.
disabled
Names of disabled shell built-in commands.
enabled
Names of enabled shell built-in commands.
function
Names of shell functions.
group
Group names.
helptopic
Help topics as allowed by the help built-in command.
hostname
Hostnames, as found in the file named by $HOSTFILE.
job
Job names.