shell
文章平均质量分 70
Siedler
Anthropic Principle
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
综合输出系统信息的简单脚本
可以清晰有条理地显示出当前系统的OS、IP等信息。脚本代码如下:#!/bin/bashclearif [[ $# -eq 0 ]];thenreset_color=$(tput sgr0)os_name=$(uname -o)echo -e '\E[32m'"OS Type:" $reset_color $os_nameos_version=$(cat /etc/issue|gre原创 2016-08-31 16:05:55 · 479 阅读 · 0 评论 -
编辑vimrc,使新建文件自动写入文件头
在创建脚本时,自动写入包含文件名、作者、邮箱、创建时间等信息的文件头。这里只对.sh和.py文件进行自动写入设置。打开vim配置文件vim /etc/vimrc加入如下代码autocmd BufNewFile *.py,*.sh, exec ":call SetTitle()"let $author_name = "xxxx"let $author_email = "xxxx@原创 2016-08-31 10:10:39 · 3867 阅读 · 0 评论
分享