shell脚本判断
#!/bin/bash timestamp=$(date +%s) filetimestamp=$(stat -c %Y filename) #echo $timestamp #echo $filetimestamp #echo $[$timestamp - $filetimestamp] if [ $[$timestamp - $filetimestamp] -lt 300 ]; then command ... else command ... fi
-lt:小于
shell脚本判断
#!/bin/bash timestamp=$(date +%s) filetimestamp=$(stat -c %Y filename) #echo $timestamp #echo $filetimestamp #echo $[$timestamp - $filetimestamp] if [ $[$timestamp - $filetimestamp] -lt 300 ]; then command ... else command ... fi
-lt:小于