Re: bash vs. dash and stdin

2023-11-23 Thread Max Nikulin
On 22/11/2023 19:17, Greg Wooledge wrote: On Wed, Nov 22, 2023 at 07:06:58PM +0700, Max Nikulin wrote: ssh localhost echo remote echo local This is like . ssh grabs all of the stdin (until EOF) and leaves none for bash. Thanks. I expected

Re: bash vs. dash and stdin

2023-11-22 Thread Nicolas George
Max Nikulin (12023-11-22): > Is there a document that describes shell behavior in respect to stdin in > such cases? The shell did not eat your stdin here, ssh did. Regards, -- Nicolas George

Re: bash vs. dash and stdin

2023-11-22 Thread Greg Wooledge
On Wed, Nov 22, 2023 at 07:06:58PM +0700, Max Nikulin wrote: > Consider a file (ssh.sh) containing a couple of commands: > >ssh localhost echo remote >echo local > > Let's try to run it (assuming key-based authorization) > > bash remote You're trying to use stdin twice at the

bash vs. dash and stdin

2023-11-22 Thread Max Nikulin
Hi, There was a thread on stdio buffering and fork a month ago. That time I thought shells should be rather careful with input/output handling when spawning subprocesses. Consider a file (ssh.sh) containing a couple of commands: ssh localhost echo remote echo local Let's try to run