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

Bun.$ expected a command or assignment but got: "Redirect" when multiple redirects #9455

Open
aboqasem opened this issue Mar 16, 2024 · 3 comments
Assignees
Labels
bug Something isn't working shell Something to do with Bun as a shell

Comments

@aboqasem
Copy link

aboqasem commented Mar 16, 2024

What version of Bun is running?

1.0.31+e25675121

What platform is your computer?

Darwin 23.3.0 x86_64 i386

What steps can reproduce the bug?

echo Hello 2>/dev/null 1>&2

bun --print 'Bun.$`echo Hello 2>/dev/null 1>&2`'

What is the expected behavior?

To work.

What do you see instead?

expected a command or assignment but got: "Redirect"

Additional information

No response

@aboqasem aboqasem added the bug Something isn't working label Mar 16, 2024
@aboqasem
Copy link
Author

Also, I was trying to use the .sh file loader, but it's not working.

echo "echo hello" > test.sh && bun ./test.sh # error: Expected ";" but found "hello"

@gvilums
Copy link
Contributor

gvilums commented Mar 18, 2024

@zackradisic correct me if I'm wrong here, but I think this is because we simply don't support redirection between file descriptors in the bun shell. Regarding the .sh file loader, that is indeed a bug and needs to be fixed.

@zackradisic
Copy link
Contributor

Bun shell currently does not support multiple redirects, I will change the error message to be more descriptive

@zackradisic zackradisic self-assigned this Mar 18, 2024
@zackradisic zackradisic added the shell Something to do with Bun as a shell label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working shell Something to do with Bun as a shell
Projects
None yet
Development

No branches or pull requests

3 participants