T
T
tunelix2015-01-26 17:15:51
bash
tunelix, 2015-01-26 17:15:51

How does autosubstitution work in bash for TAB?

How does autocompletion work in bash?
For example, I write git stat , I press tab, and the command is completed to status .
Is it possible to do this for bash scripts (*.sh)?
Thanks

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Karabanov, 2015-01-27
@karabanov

Using bash completion on the command line, ...
Using bash completion on the command line, ...

K
Konstantin, 2015-01-26
@fallen8rwtf

add your directory with sh-scripts to the list of env environment variables and when you press Tab you will be prompted to select your script
* $ PATH variable

N
n3k0, 2015-01-26
@n3k0

I'm not exactly sure, but I think that ls stat* is executed and the result is substituted.
After all, if there are status1 and status2 files in the folder, bash will not substitute the name of a specific file, but will show files starting with "stat".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question