防止shell脚本重复执行的代码
例如,要求脚本只能顺序访问某个资源,例如磁盘文件等,就可以参考下面的实现。复制代码 代码如下:#!/bin/bash## file locking using bash.# ver 0.1.6## author : malundao ( malundao@sina.com )# date : 2011-08-31 # ref : http://unix.derkeiler.com/Newsgroups/comp.unix.shell/2005-09/047...