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

In POSIX sh, >& is undefined when using variables representing file descriptors #1515

Open
3 of 4 tasks
Earnestly opened this issue Mar 13, 2019 · 1 comment
Open
3 of 4 tasks

Comments

@Earnestly
Copy link

For bugs

  • Rule Id (if any, e.g. SC1000): SC2039
  • My shellcheck version (shellcheck --version or "online"): 0.6.0
  • The rule's wiki page does not already cover this (e.g. https://shellcheck.net/wiki/SC2086)
  • I tried on shellcheck.net and verified that this is still a problem on the latest commit

For new checks and feature suggestions

Here's a snippet or screenshot that shows the problem:

#!/bin/sh
fd=3
exec 3>&1
printf 'test\n' >&"$fd"

Here's what shellcheck currently says:

In t.sh line 4:
printf 'test\n' >&"$fd"
                ^-----^ SC2039: In POSIX sh, >& is undefined.

For more information:
  https://www.shellcheck.net/wiki/SC2039 -- In POSIX sh, >& is undefined.

Here's what I wanted or expected to see:

Nothing.

@0xallie
Copy link

0xallie commented May 11, 2021

I just ran into this issue as well.

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

No branches or pull requests

1 participant