
shell
wgembed
这个作者很懒,什么都没留下…
展开
-
shell脚本配置环境变量时 source XXX.sh与 ./XXX.sh的区别
配置当前终端的环境变量,写一个脚本来执行,但./XXX.sh的时候,脚本里面打印PATH是改了,但是在终端echo $PATH却没有看到变化,因为这样执行等于说不在当前进程换source XXX.sh或. XXX.sh即可见效原创 2014-03-28 11:23:08 · 6285 阅读 · 0 评论 -
3G_Auto_Restarter脚本
定时监视XXX进程,若没有了,重新启动,“>/dev/null 是讲log输出到空设备,不想看”#!/bin/shwhile true do if pidof /etc/init.d/ppp_start start >/dev/null; then echo "check 3G modem" else echo "start 3G modem原创 2014-03-27 16:32:43 · 736 阅读 · 0 评论 -
查找当前目录以下重复的头文件并输出
拷贝以下代码,保存为.sh文件执行#!/bin/bash dir_arr=$(find -name "*h" -print;) temp_path="temp_path.txt" if [ -f $temp_path ]; then rm -r $temp_path fi for dir in ${dir_arr[*]} do f原创 2014-02-22 12:21:16 · 601 阅读 · 0 评论 -
cp 拷贝时保留目录结构应用实例
批量提取项目中修改的文件先做git status原创 2014-09-29 13:47:25 · 9548 阅读 · 0 评论