From: Kent Gibson <warthog618@gmail.com>
To: esben@geanix.com
Cc: linux-gpio@vger.kernel.org
Subject: Re: [RFC PATCH] gpioset: only print prompt when stdout is tty
Date: Wed, 24 May 2023 16:50:12 +0800 [thread overview]
Message-ID: <ZG3PxEEjYSacBrja@sol> (raw)
In-Reply-To: <87edn69lee.fsf@geanix.com>
On Wed, May 24, 2023 at 10:35:53AM +0200, esben@geanix.com wrote:
> Kent Gibson <warthog618@gmail.com> writes:
>
> > On Wed, May 24, 2023 at 09:53:39AM +0200, esben@geanix.com wrote:
> >> Kent Gibson <warthog618@gmail.com> writes:
> >>
> >>
> >
> > Not just for testing.
> >
> > In the real world the prompt is there so the controlling script can tell
> > a command is completed - same as a human would.
>
> And still you say that I should probably redirect it to /dev/null ...
>
Those are two different use cases.
Redirect for the simple daemon/fifo, using the prompt with the coproc.
>
> So when you call read(2) on a named pipe opened in blocking mode, but
> without any writers, you don't simply get an immediate return with 0,
> indicating EOF? That is what I saw when I tested it previously.
> If not, I probably just messed up back then. Sorry about that.
>
gpioset doesn't do the open or read on the fifo itself, bash does.
gpioset just reads from its stdin, and that blocks.
Have you actually tried my script?
> > You missed writing your own daemon. Or asking ChatGPT.
> > But you do have options.
>
> Yes, you always have options, and I will go with one of them. I will
> probably not go with ChatGPT though ;)
>
Where do you think I get my answers ;-)?
Cheers,
Kent.
prev parent reply other threads:[~2023-05-24 8:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-23 13:54 [RFC PATCH] gpioset: only print prompt when stdout is tty Esben Haabendal
2023-05-23 15:36 ` Kent Gibson
2023-05-24 6:30 ` esben
2023-05-24 7:32 ` Kent Gibson
2023-05-24 7:53 ` esben
2023-05-24 8:12 ` Kent Gibson
2023-05-24 8:35 ` esben
2023-05-24 8:50 ` Kent Gibson [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=ZG3PxEEjYSacBrja@sol \
--to=warthog618@gmail.com \
--cc=esben@geanix.com \
--cc=linux-gpio@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.