Calculate modulo in sh script
If your sh really is sh and not just bash being run as sh then this will work just fine if [ `expr $n % 5` -eq 0 ] then # do something fi If your sh is really bash then put your test in (( )) like so if (( $n % 5 == … Read more