From owner-freebsd-questions@FreeBSD.ORG Wed Aug 31 18:15:49 2005 Return-Path: X-Original-To: freebsd-questions@FreeBSD.ORG Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E8B9116A41F for ; Wed, 31 Aug 2005 18:15:49 +0000 (GMT) (envelope-from kline@tao.thought.org) Received: from tao.thought.org (dsl231-043-140.sea1.dsl.speakeasy.net [216.231.43.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC5B343D55 for ; Wed, 31 Aug 2005 18:15:46 +0000 (GMT) (envelope-from kline@tao.thought.org) Received: from tao.thought.org (localhost [127.0.0.1]) by tao.thought.org (8.13.1/8.13.1) with ESMTP id j7VIFji5058367 for ; Wed, 31 Aug 2005 11:15:45 -0700 (PDT) (envelope-from kline@tao.thought.org) Received: (from kline@localhost) by tao.thought.org (8.13.1/8.13.1/Submit) id j7VIFjnE058366 for freebsd-questions@FreeBSD.ORG; Wed, 31 Aug 2005 11:15:45 -0700 (PDT) (envelope-from kline) Date: Wed, 31 Aug 2005 11:15:45 -0700 From: Gary Kline To: FreeBSD Mailing List Message-ID: <20050831181545.GA57907@thought.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: Observing 19 years of service to the Unix community Cc: Subject: Doing a modulo in /bin/sh?? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2005 18:15:50 -0000 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? tia, guys, gary #/bin/sh w=$(date +%U) echo "w is $w"; (even=$(w % 2 )); ## flubs. echo "even is $even"; ## flubs. if [ $even -eq 0 ] ## flubs, obv'ly. then echo "week is even"; else echo "week is odd"; fi -- Gary Kline kline@thought.org www.thought.org Public service Unix