From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Cohen, Andy" Newsgroups: gmane.os.tru64.managers Subject: SUMMARY: ksh math Date: Wed, 30 Jun 2004 16:29:07 -0400 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <9D592DB37A92234AB635C5585D2D08190135D340@cobra.pc.cognex.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1088627381 15789 80.91.224.253 (30 Jun 2004 20:29:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 30 Jun 2004 20:29:41 +0000 (UTC) Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Wed Jun 30 22:29:35 2004 Return-path: Original-Received: from sws1.ornl.gov ([160.91.1.101]) by deer.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 1Bfli3-0004RJ-00 for ; Wed, 30 Jun 2004 22:29:35 +0200 Original-Received: (qmail 32251 invoked by uid 5); 30 Jun 2004 20:29:29 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 32191 invoked by uid 49501); 30 Jun 2004 20:29:29 -0000 Original-Received: from Andy.Cohen@cognex.com by sws1 by uid 49491 with qmail-scanner-1.21 (clamdscan: 0.70-rc. iscan: v3.1/v5.600-1011/847/50540. spamassassin: 2.63. Clear:RC:0(160.91.4.119):SA:0(-4.9/5.0):. Processed in 0.536366 secs); 30 Jun 2004 20:29:29 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (160.91.4.119) by 0 with SMTP; 30 Jun 2004 20:29:28 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.2-X27 #30899) with ESMTP id <0I050044S28W1J@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 30 Jun 2004 16:29:27 -0400 (EDT) Original-Received: from VIRUSCAN-DAEMON.emroute1.cind.ornl.gov by emroute1.cind.ornl.gov (PMDF V6.2-X27 #30899) id <0I0500H0228RMO@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 30 Jun 2004 16:29:17 -0400 (EDT) Original-Received: from cognex.cognex.com (cognex-cp.cognex.com [198.232.30.75]) by emroute1.cind.ornl.gov (PMDF V6.2-X27 #30899) with ESMTP id <0I0500H3W28ND0@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 30 Jun 2004 16:29:15 -0400 (EDT) Original-Received: from atlantis.pc.cognex.com (atlantis.pc.cognex.com [10.10.160.5]) by cognex.cognex.com (8.12.11/8.12.11) with ESMTP id i5UKT7et016622 for ; Wed, 30 Jun 2004 16:29:07 -0400 (EDT) Original-Received: from cobra.pc.cognex.com ([10.10.160.30]) by atlantis.pc.cognex.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 30 Jun 2004 16:29:07 -0400 Original-To: "Tru64-Unix-Managers \(E-mail\)" X-MIMEOLE: Produced By Microsoft Exchange V6.0.6334.0 Thread-Topic: ksh math Thread-Index: AcRe3fG7CuRezgBoQWy1wMeKqbaSCA== content-class: urn:content-classes:message X-MS-Has-Attach: X-MS-TNEF-Correlator: X-OriginalArrivalTime: 30 Jun 2004 20:29:07.0538 (UTC) FILETIME=[E4AC0320:01C45EE0] Xref: main.gmane.org gmane.os.tru64.managers:7211 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:7211 A fairly simple solution - one that I thought I had tried but obviously = not. This is what I chose to use: export PREV_RUN_DATE=3D$(( $RUN_DATE - 1 )) This also worked: let PREV_RUN_DATE=3D$RUN_DATE-1 Thanks to Charlie Ballowe, Bob Sloane, Mark Scarborough, and Dr. Tom = Blinn ORIGINAL QUESTION =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D I don't know what I'm missing -- all I want to do is do some very basic = math on a variable but I can't figure it out. I've searched the = archives, google, manuals, etc. and can't find anything that clarifies = it. I have a variable $RUN_DAY and I want to subtract one (1) from it. How = do I do that? I thought it would be: export PREV_DAY=3D${RUN_DAY}-1 but it doesn't work. I've tried quite a number of variations on this = all to no avail. I'm using: Tru64 5.1A korn shell (ksh) Thank you! Andy Cohen=20 Database Systems Administrator=20 Cognex Corporation=20 1 Vision Drive=20 Natick, MA 01760=20 508-650-3079=20