first : add follow context in   /etc/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,"#")
call setline(3,"#********************************************************************")
call setline(4,"#Author: panzidong")
call setline(5,"#Date: ".strftime("%Y-%m-%d"))
call setline(6,"#FileName: ".expand("%"))
call setline(7,"#URL: https://www.cnblogs.com/lianghong881018")
call setline(8,"#Description: The test script")
call setline(9,"#Copyright (C): ".strftime("%Y")." All rights reserved")
call setline(10,"#********************************************************************")
call setline(11,"#")
call setline(12,"")
endif
endfunc
autocmd BufNewFile * normal G

second: create new shell scipt

vim pan.sh

shell script auto generate the relevant header information的更多相关文章

  1. Shell Script Basics

    https://developer.apple.com/library/mac/documentation/OpenSource/Conceptual/ShellScripting/shell_scr ...

  2. (copy) Shell Script to Check Linux System Health

    source: http://linoxide.com/linux-shell-script/shell-script-check-linux-system-health/ This article ...

  3. PHP错误Warning: Cannot modify header information - headers already sent by解决方法

    这篇文章主要介绍了PHP错误Warning: Cannot modify header information - headers already sent by解决方法,需要的朋友可以参考下 今天在 ...

  4. How to Create a First Shell Script

    How to Create a First Shell Script   Shell scripts are short programs that are written in a shell pr ...

  5. 学习shell script

    摘要:概述.script的编写.test命令.[]判断符号.默认变量($1...).if...then条件判断式. 一.概述 [什么是shell script] 针对shell所写的脚本,将多个命令汇 ...

  6. Shell script之How to write

    Write shell script: 1) Editor like vi or mcedi 2) Set execute permission for your script chmod  perm ...

  7. shell script简单笔记

    变量 shell script是一种脚本语言,变量的定义是通过 myName=HYB 这样的形式定义的. 当存在空格时,可以通过双引号或单引号将其变为字符串.双引号不进行转义,单引号将内容进行转义为一 ...

  8. shell 编程 && bash 简介(shell 变量、shell操作环境、数据流重导向、管线命令、shell script)

    如何学习一门编程语言 数据类型 运算符 关键字 1 认识BASH 这个shell linux是操作系统核心,用户通过shell与核心进行沟通,达到我们想要的目的.硬件.核心.用户之间的关系: 原理:所 ...

  9. shell及脚本4——shell script

    一.格式 1.1 开头 必须以 "# !/bin/bash"  开头,告诉系统这是一个bash shell脚本.注意#与!中间有空格. 二.语法 2.1 数值运算 可以用decla ...

随机推荐

  1. [原][粒子特效][spark]粒子系统system、主节点group、渲染器render

    深入浅出spark粒子特效连接:https://www.cnblogs.com/lyggqm/p/9956344.html system: A class defining a complete sy ...

  2. git的安装以及生成ssh key

    安装git 在ubuntu系统下输入以下命令安装git软件: sudo apt-get install git 输入以下命令查看git是否安装成功: git --version 如下图所示则表示安装成 ...

  3. Linux修改hostname时/etc/hosts、/etc/sysconfig/network ,hostname,三者的区别和联系

    [root@localhost /]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.l ...

  4. JAVA基础知识总结:十六

    一.File类 主要用于文件操作 对存储在磁盘上的文件和目录的抽取和封装 二.IO流 1.概念 File类只能创建或者修改文件或者文件夹的层级结构,如果要访问文件中的内容的话,就需要用到IO流(Inp ...

  5. Python Appium 滑动、点击等操作

    Python Appium 滑动.点击等操作 1.手机滑动-swipe # FileName : Tmall_App.py # Author : Adil # DateTime : 2018/3/25 ...

  6. Memcached安装&启动

    安装 *Linux系统安装memcached,首先要先安装libevent库,安装请指定 --with--libevent=PATH(若安装过程中出现configure: error : no acc ...

  7. LeetCode--012--整数转罗马数字(java)

    罗马数字包含以下七种字符: I, V, X, L,C,D 和 M. 字符 数值 I 1 V 5 X 10 L 50 C 100 D 500 M 1000 例如, 罗马数字 2 写做 II ,即为两个并 ...

  8. int __get_order(unsigned long size)

    2017-12-6 10:26:504.9.51int __get_order(unsigned long size){    int order; size--;    size >>= ...

  9. cmd net use

    前提条件 启动服务 首先保证目标的IPC服务启动,服务为lanmanWorkstation,显示名为Workstations 端口 telnet目标计算机lanmanWorkstation服务的两个端 ...

  10. php实现队列

    <?php //双向队列的实现 class DoubleEndedQueue{ public $elements; public function __construct(){//析构函数,创建 ...