
shell
文章平均质量分 70
Siedler
Anthropic Principle
展开
-
综合输出系统信息的简单脚本
可以清晰有条理地显示出当前系统的OS、IP等信息。 脚本代码如下:#!/bin/bash clear if [[ $# -eq 0 ]];then reset_color=$(tput sgr0) os_name=$(uname -o) echo -e '\E[32m'"OS Type:" $reset_color $os_name os_version=$(cat /etc/issue|gre原创 2016-08-31 16:05:55 · 421 阅读 · 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 · 3822 阅读 · 0 评论