public inbox for speakup@linux-speakup.org
 help / color / mirror / Atom feed
From: Gregory Nowak <greg@romuald.net.eu.org>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Subject: Re: IF Help
Date: Sat, 22 Apr 2006 12:53:13 -0700	[thread overview]
Message-ID: <20060422195313.GB19750@localhost.localdomain> (raw)
In-Reply-To: <005f01c6663e$e093dcb0$1d02a8c0@sparky>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

There is no man page for the if command. What you want to look at is
the bash(1) man page, which is a long one.

I am by no means an expert when it comes to bash programming, so I do
stand to be corrected, but from
what I noticed, 2 problems come to mind right away when looking at
your if statement. First, you want to enclose the condition part in
brackets. Second, since file, and number, are shell variables, they should be in all
caps. 

So, rewriting your below code snipit with the 2 fixes I mentioned
would look like:

if [ date -r $FILE +%V -lt $NUMBER ]; then
#statements
fi

Hth.

Greg


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

- -- 
web site: http://www.romuald.net.eu.org
gpg public key: http://www.romuald.net.eu.org/pubkey.asc
skype: gregn1
(authorization required, add me to your contacts list first)

- --
Free domains: http://www.eu.org/ or mail dns-manager@EU.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFESomp7s9z/XlyUyARAlW9AJ96N8O3qTXuKYHVijICUShfjqBSXwCgqRM6
xBTxx4KF10KD3JmTNRTZF/U=
=9OTu
-----END PGP SIGNATURE-----


  reply	other threads:[~ UTC|newest]

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

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=20060422195313.GB19750@localhost.localdomain \
    --to=greg@romuald.net.eu.org \
    --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).