Skip to content

fix(docs): correct stderr redirection typos in redirections examples#286

Merged
yassinebenaid merged 1 commit intoyassinebenaid:masterfrom
wucm667:fix/doc-redirection-typo
Apr 28, 2026
Merged

fix(docs): correct stderr redirection typos in redirections examples#286
yassinebenaid merged 1 commit intoyassinebenaid:masterfrom
wucm667:fix/doc-redirection-typo

Conversation

@wucm667
Copy link
Copy Markdown
Contributor

@wucm667 wucm667 commented Apr 28, 2026

Fixes #282

Problem

The documentation examples for redirecting both stdout and stderr contain a typo: 2>&2 redirects stderr to itself, which is incorrect.

Solution

Change 2>&2 to 2>&1 so that stderr is correctly redirected to stdout (which is already pointing to the file).

Changes

Fixed in docs/features/redirections.md:

  • Line 87: echo "Hello World" 1>file.txt 2>&22>&1
  • Line 110: echo "Hello World" 1>>file.txt 2>&22>&1

Change '2>&2' to '2>&1' in shell redirection examples.
Standard error should redirect to file descriptor 1 (stdout), not 2.

Fixes yassinebenaid#282
@yassinebenaid yassinebenaid merged commit e6cacb4 into yassinebenaid:master Apr 28, 2026
7 checks passed
@wucm667 wucm667 deleted the fix/doc-redirection-typo branch April 29, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redirection examples have typo in file descriptor number

2 participants