Re: [RFC PATCH] gpioset: only print prompt when stdout is tty

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 24, 2023 at 10:35:53AM +0200, esben@xxxxxxxxxx wrote:
> Kent Gibson <warthog618@xxxxxxxxx> writes:
> 
> > On Wed, May 24, 2023 at 09:53:39AM +0200, esben@xxxxxxxxxx wrote:
> >> Kent Gibson <warthog618@xxxxxxxxx> 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.



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux