Use Linux custom auto-completion command to complete your shell script
Source: Internet
Author: User
Using Linux custom auto-completion commands to improve your shell scripts, you will often write some general deployment scripts, such. /java-build.sh project name will automatically pull the project from hg, and then maven compiled and deployed to the specified server, the whole process through this shel...
Using Linux custom auto-completion commands to improve your shell scripts, you will often write some general deployment scripts, such. /The java-build.sh project name will automatically pull the project from hg, and then maven compiled and deployed to the specified server, the whole process is automated through this shell script. Www.2cto.com, but sometimes the project name is too long to be remembered. at this time, you need Linux custom auto-completion functions. for example, if a project is called game-server, then I only need to enter. /java-build.sh g and then press tab to automatically complete. /java-build.sh game-server. Linux provides a custom auto-completion command, called complete. from man, we can see that this is a very complex command. However, most of the commands I can't use now only use one-W parameter, it means to write the command to complete, the usage of the entire command: complete-W "game-server game-web-server" java-build.sh and then write this command ~ /. Bashrc to initialize the shell environment.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.