In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today I'll show you how the shell script automatically generates comments at the beginning of the file. The content of the article is good. Now I would like to share it with you. Friends who feel in need can understand it. I hope it will be helpful to you. Let's read it along with the editor's ideas.
When we write bash scripts, we need to write comments in shell. It is very troublesome to write notes manually every time. This article will share with you how to automatically generate comments and introductions in the file.
Let's share a template file of the shell script. Copy it to the user's home directory / root/ and name it .vimrc, so that some comments will be generated automatically when you open the .sh file later. You only need to modify it slightly:
Set ignorecase set cursorline set autoindent autocmd BufNewFile * .sh exec ": call SetTitle ()" func SetTitle () if expand ("%: e") = 'sh' call setline (1, "#! / bin/bash") call setline (2 "# *") call setline (3, "# Author: XT_TALK") call setline (4 "# Date:" .strftime ("% Y-%m-%d") call setline (5, "# FileName:" .call setline ("%")) call setline (6 "# *") call setline (7 "") endif endfunc autocmd BufNewFile * normal G and above are all about how the shell script automatically generates comments at the beginning of the file For more information about how the shell script automatically generates comments at the beginning of the file, you can search for previous articles or browse the following articles to learn! I believe the editor will add more knowledge to you. I hope you can support it!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.