Skip to content
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

Merged
merged 2 commits into from
Mar 9, 2022
Merged

Conversation

git-em
Copy link
Contributor

@git-em git-em commented Mar 2, 2022

  • The page (if new), does not already exist in the repository.
  • The page is in the correct platform directory (common/, linux/, etc.)
  • The page has 8 or fewer examples.
  • The PR title conforms to the recommended templates.
  • The page follows the content guidelines.
  • The page description includes a link to documentation or a homepage (if applicable).

Version of the command being documented (if known):
setsid from util-linux 2.37.4

@github-actions github-actions bot added the new command Issues requesting creation of a new page. label Mar 2, 2022
@git-em
Copy link
Contributor Author

git-em commented Mar 2, 2022

Listed on #2214


- Run a program in a new session discarding the resulting output and error:

`setsid {{program}} > /dev/null 2>&1`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`setsid {{program}} > /dev/null 2>&1`
`setsid {{program}} > &> /dev/null`

Copy link
Contributor Author

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).

Copy link
Contributor

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.

pages/linux/setsid.md Outdated Show resolved Hide resolved

- Run a program in a new session discarding the resulting output and error:

`setsid {{program}} > /dev/null 2>&1`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`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.

Copy link
Contributor Author

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>
Copy link
Member

@CleanMachine1 CleanMachine1 left a 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

@EmilyGraceSeville7cf EmilyGraceSeville7cf merged commit c5309c0 into tldr-pages:main Mar 9, 2022
@EmilyGraceSeville7cf
Copy link
Contributor

Merged, thanks! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new command Issues requesting creation of a new page.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants