From:   Pádraig Brady
Subject: bug#80010: timeout echo vs. timeout cat
Date:   Mon, 15 Dec 2025 13:28:04 +0000

>I agree that this behavior isn't obvious. :)

It is, once you realize how shells work.

>We should probably better document timeout's interactions with shell 
>constructs,
>as it's a common question and tricky to see what's going on.

As I said, you just need to be aware that if a string contains shell
metas (e.g., ">"), then it needs to be run through a shell.  This
issue arises in the context of "make" programs; usually, "make"
programs examine the string they are asked to execute, checking for
the presence of shell metas, and run it directly only if there are none.

I was about to say that "timeout" could do likewise, but that
obviously is not practical.  The user needs to be aware of the
problem and deal with it explicitly.

The solution, of course, is to make "timeout" a shell keyword (not a
builtin), like "time" and "[[" (and unlike "[").

I'm mostly kidding, but it is true that that's what it would take.

>I'll see can I come up with something for the info docs

Until we get the real solution, that's the best we can do.

=================================================================================
Please do not send me replies to my posts on the list.
I always read the replies via the web archive, so CC'ing to me is unnecessary.

When responding to my posts, please try to refrain from giving bureaucratic 
answers.
If you have nothing useful to say, then just click Next and go on.



Reply via email to