[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
The standard input of background processes
From: |
ievojeewai |
Subject: |
The standard input of background processes |
Date: |
Thu, 23 May 2024 19:45:40 +0900 |
User-agent: |
mblaze/1.2 |
Perhaps this is a naïve question, but what is going on with the output behavior
differences with the example below?
$ f()(cat); echo dramatic meow | f
dramatic meow
$ f()(cat&); echo furiously green | f # no output
$ echo trebuchet rockets | (cat&)
trebuchet rockets
$ f(){ cat&}; echo drop that eel | f
drop that eel
I am failing to understand some interaction between functions, subshells, and
how stdin gets set on background processes.
Note that in dash, only the first example produces output, so it appears that
_all_ subshells fail to inherit (a copy of?) stdin in this case. Is this
perhaps specced in POSIX.1-2017 somewhere?
Any pointers in the right direction would be much appreciated.
- The standard input of background processes,
ievojeewai <=