public inbox for speakup@linux-speakup.org
 help / color / mirror / Atom feed
From: "Chris Norman" <cnorman@rnibncw.ac.uk>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Subject: Re: IF Help
Date: Mon, 24 Apr 2006 00:44:06 +0100	[thread overview]
Message-ID: <005301c6672f$d1181ca0$1d02a8c0@sparky> (raw)
In-Reply-To: <20060423164955.GA12848@sunset.net>

Cheers mate.

Chris Norman
<!-- chris.norman4@ntlworld.com -->
----- Original Message ----- 
From: "Ralph W. Reid" <rreid@sunset.net>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Sunday, April 23, 2006 5:49 PM
Subject: Re: IF Help


> 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
>> <!-- chris.norman4@ntlworld.com -->
>> _______________________________________________
>> 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
> 
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup


      reply	other threads:[~ UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
 Chris Norman
 ` Gregory Nowak
 ` Georgina Joyce
   ` Chris Norman
   ` ace
 ` Ralph W. Reid
   ` Chris Norman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='005301c6672f$d1181ca0$1d02a8c0@sparky' \
    --to=cnorman@rnibncw.ac.uk \
    --cc=speakup@braille.uwo.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).