Doing a modulo in /bin/sh??
kline at tao.thought.org
Wed Aug 31 18:15:50 GMT 2005
I can grab the results of "w=$date+%U)"; in C an use the modulo
operator; is there a way to do this is /bin/sh? ot zsh?
echo "w is $w";
(even=$(w % 2 )); ## flubs.
echo "even is $even"; ## flubs.
if [ $even -eq 0 ] ## flubs, obv'ly.
echo "week is even";
echo "week is odd";
Gary Kline kline at thought.org www.thought.org Public service Unix
More information about the freebsd-questions