From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ns1.sunset.net ([205.161.255.5] helo=onyx.sunset.net) by speech.braille.uwo.ca with esmtp (Exim 3.36 #1 (Debian)) id 1FXhmc-0002q3-00 for ; Sun, 23 Apr 2006 12:50:02 -0400 Received: from sunset.net (198-69-251-230.chico.ca.digitalpath.net [198.69.251.230]) by onyx.sunset.net (8.12.10/8.12.10) with ESMTP id k3NGhdSj008719 for ; Sun, 23 Apr 2006 09:43:39 -0700 Received: (from rreid@localhost) by sunset.net (8.13.6/8.13.6/Submit) id k3NGnunA012917 for speakup@braille.uwo.ca; Sun, 23 Apr 2006 09:49:56 -0700 Date: Sun, 23 Apr 2006 09:49:55 -0700 From: "Ralph W. Reid" To: "Speakup is a screen review system for Linux." Subject: Re: IF Help Message-ID: <20060423164955.GA12848@sunset.net> References: <005f01c6663e$e093dcb0$1d02a8c0@sparky> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <005f01c6663e$e093dcb0$1d02a8c0@sparky> User-Agent: Mutt/1.4.2.1i X-BeenThere: speakup@braille.uwo.ca X-Mailman-Version: 2.1.8rc1 Precedence: list Reply-To: "Speakup is a screen review system for Linux." List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Apr 2006 16:50:03 -0000 You were very close for not finding the info in a man page. If I can assume you are using the bash shell, then the 'if' command is described somewhere in the midst of the bash man page (it's a _big_ man page, but lots of good stuff is in there). I suppose you want to use the output of a command in a comparison. This means that the command should be enclosed in accent marks. Also, you need some brackets, a semicolon, and the word 'then' to complete the syntax. Here is what I think you want (note that the spacing around the brackets is important, as well as all of the punctuation in the 'if' line): if [ `date -r $file +%V` -lt $number ]; then echo It be. else echo It be not. fi HTH, and have a _great_ day. On Sat, Apr 22, 2006 at 07:59:24PM +0100, Chris Norman wrote: > Hi people, > I want to use the if command, but can't find any manual page for it. > > I want to use it to run a command, and at present, I have: > > if date -r $file +%V -lt $number; then > #statements > fi > > But it won't work. > > $file is a filename. How do I do this? > > Cheers, > > Chris Norman > > _______________________________________________ > Speakup mailing list > Speakup@braille.uwo.ca > http://speech.braille.uwo.ca/mailman/listinfo/speakup -- Ralph. N6BNO. Wisdom comes from central processing, not from I/O. rreid@sunset.net http://personalweb.sunset.net/~rreid ...passing through The City of Internet at the speed of light! 1 = x^0