编写生成脚本的基本格式的脚本

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了编写生成脚本的基本格式的脚本相关的知识,希望对你有一定的参考价值。

编写?成脚本基本格式的脚本,

包括作者,联系?式,版本,时间,描述等 如下:

[root@Centos ~]# vim .vimrc

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,"#")           

    callsetline(3,"#********************************************************************") 

    call setline(4,"#Author:------------------------------------------------- w")

    call setline(5,"#QQ:------------------------------------------------------1****")

     call setline(6,"#Date:--------------------------".strftime("%Y-%m-%d"))

     call setline(7,"#FileName:----------------------------------- ".expand("%"))  

     call setline(8,"#URL:--------------------------- http://www.123456.com")  

    call setline(9,"#Description:----------------------------------- The test script")  

     call setline(10,"#Copyright (C-----".strftime("%Y")." All rights reserved")

    callsetline(11,"#********************************************************************")  

    call setline(12,"")  
    endif
    endfunc  
    autocmd BufNewFile * normal G  

                                                            以上“-”代表空格或者Tab键    不忘初心 砥砺前行!!!!!!!

以上是关于编写生成脚本的基本格式的脚本的主要内容,如果未能解决你的问题,请参考以下文章

使用脚本生成一堆新用户以生成newusers命令所需的输出

Thrift第三课 编写脚本

jinja2批量生成python脚本

一键生成 Android 录屏 gif 的脚本

一键生成 Android 录屏 gif 的脚本

一键生成 Android 录屏 gif 的脚本