linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Georget <laurent.georget-vbcOdlJ0SulGWvitb5QawA@public.gmane.org>
To: Tom Canavan <tmscanavan-Lh2ygAtTN0NSV923RJcDwA@public.gmane.org>
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: inotifywait man page--possible error
Date: Thu, 12 Feb 2015 09:10:48 +0100	[thread overview]
Message-ID: <54DC6008.2030501@supelec.fr> (raw)
In-Reply-To: <5820328.QymD6BquXU@midnight>

Hello Tom,

thank you for your report. Actually, this example is correct as it is. Did you copy it verbatim?
If you replace "while" by "until", the script will stop after inotifywait returns without entering the
body loop. With "while", it will enter the body loop and then, restart from inotifywait until
another modification occurs.

Of course, the script does have problems for practical use such as the fact that while
you are in the body loop, you're not watching the file anymore, and there is a race condition
which could make you miss apache events but that's because it's just a toy example.

Laurent


Le 12/02/2015 02:54, Tom Canavan a écrit :
> I noticed a problem with example no. 2 at toward the bottom of the page.  I 
> tried and tried to get this to work.  It would not.  Then I replaced the word 
> "while" with the word "until".  Then it works.  Sorry to trouble you.  I'm 
> just a beginner at scripting, and this may not be an error at all, and might 
> somehow be my fault.    Forgive me if I am wrong.  I am only relating what 
> happened on *my* system I'm using Fedora 18.  My only goal in writing you to 
> possibly save some other beginner a headache if it *is* a mistake.
>
> Tom
> --
> To unsubscribe from this list: send the line "unsubscribe linux-man" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2015-02-12  8:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12  1:54 inotifywait man page--possible error Tom Canavan
2015-02-12  7:33 ` Michael Kerrisk (man-pages)
2015-02-12  8:10 ` Laurent Georget [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=54DC6008.2030501@supelec.fr \
    --to=laurent.georget-vbcodlj0sulgwvitb5qawa@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tmscanavan-Lh2ygAtTN0NSV923RJcDwA@public.gmane.org \
    /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 NNTP newsgroup(s).