防止shell脚本重复执行
#!/bin/bash LOCK_NAME="/tmp/my.lock" if ( set -o noclobber; echo "$$" > "$LOCK_NAME") 2> /dev/null; then trap 'rm -f "$LOCK_NAME"; exit $?' INT TE...
#!/bin/bash LOCK_NAME="/tmp/my.lock" if ( set -o noclobber; echo "$$" > "$LOCK_NAME") 2> /dev/null; then trap 'rm -f "$LOCK_NAME"; exit $?' INT TE...