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. /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.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.