공부
[Sh] failed script timer
승가비
2020. 12. 16. 04:22
728x90
s=$(date +%s)
sleep 3s
e=$(date +%s)
diff=`expr ${e} - ${s}`
if [ ${diff} -lt 30 ]; then
echo $diff
exit 1
fi
https://qastack.kr/ubuntu/892604/meaning-of-exit-0-exit-1-and-exit-2-in-a-bash-script
bash 스크립트에서 종료 0, 종료 1 및 종료 2의 의미
qastack.kr
Less than operator '<' in if statement results in 'No such file or directory'
Sure this is a simple one - still learning my way around sh scripts. I've got:- if [ $3 < 480 ]; then blah blah command else blah blah command2 fi $3 is a passed variable, again an integer.
stackoverflow.com
https://stackoverflow.com/questions/8385627/subtract-two-variables-in-bash
Subtract two variables in Bash
I have the script below to subtract the counts of files between two directories but the COUNT= expression does not work. What is the correct syntax? #!/usr/bin/env bash FIRSTV=`ls -1 | wc -l` cd ..
stackoverflow.com
728x90