Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • Thank you so much for the reply! So when putting a process in bg, it will fork a new process (although it's a built-in), otherwise the whole terminal environment (the currently opened terminal) would be affected temporarily when I redirect stdout and stdin for two built-in commands (both in bg) and assuming that it didn't fork new processes there would be a conflict (in the sense of both commands get the same stdin or stdout) as I described because both built-in commands changed the stdin or stdout to different files and were not forked. Commented Jul 25, 2022 at 17:01
  • It may help to drop the "whole terminal environment" notion; a shell process can run without a terminal, for example as a cron job, or a script run as part of the system boot process. Redirections are internal to a process, and in no way involve the parent process, regardless of whether the parent happens to be a terminal (e.g. xterm) or not (e.g. crond, the system init, ...). Commented Jul 25, 2022 at 20:00