-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setsid: add page #7841
setsid: add page #7841
Conversation
Listed on #2214 |
|
||
- Run a program in a new session discarding the resulting output and error: | ||
|
||
`setsid {{program}} > /dev/null 2>&1` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`setsid {{program}} > /dev/null 2>&1` | |
`setsid {{program}} > &> /dev/null` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially written like this, but when i tested it in dash
it didn't work, so i opted for the most shell agnostic and maybe POSIX compliant way (if i understood this well).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, maybe it's better to leave your code unchanged because Tl;Dr
is not restricted to concrete shells.
|
||
- Run a program in a new session discarding the resulting output and error: | ||
|
||
`setsid {{program}} > /dev/null 2>&1` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`setsid {{program}} > /dev/null 2>&1` | |
`setsid {{program}} >/dev/null 2>&1` |
I prefer this, I've never seen &>
and don't know what it does neither how portable it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the space between the ">
" and the following text is good practice, as seen on this page about redirection in bash
.
As for the &>
, it's a convenient way to redirect stdout and stderr, present in bash
(see previous link) and zsh
, but not in some other shells.
Co-authored-by: pixel <chrissx@chrissx.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once @EmilySeville7cfg's review is done, please merge
Merged, thanks! ❤️ |
common/
,linux/
, etc.)Version of the command being documented (if known):
setsid from util-linux 2.37.4