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

Bug: the installation command is not working for non posix shells #1659

Closed
anki-code opened this issue Jan 31, 2024 · 6 comments
Closed

Bug: the installation command is not working for non posix shells #1659

anki-code opened this issue Jan 31, 2024 · 6 comments

Comments

@anki-code
Copy link

anki-code commented Jan 31, 2024

Hello! Thank you for atuin it's awesome!

Please fix the installation command on https://atuin.sh/ and in the repository:

bash <(curl --proto '=https' --tlsv1.2 -sSf https://setup.atuin.sh)
# xonsh: SyntaxError
# fish: Invalid redirection target

This syntax is not working on non POSIX shells like xonsh.

The right way to do this is run bash -c command e.g. https://brew.sh/:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Thanks!

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

@akinomyoga
Copy link
Contributor

I suspect you have xonsh or fish installed with the name bash. If that is the case, I don't think that is a sane environment. All the Bash scripts with the shebang #!/usr/bin/env bash (which is the recent standard) are broken in such an environment. You may skip the processing of shebang by specifying -c, but I don't think that can be an essential solution.

@ellie
Copy link
Member

ellie commented Jan 31, 2024

I think it's more the issue that <(...blah) isn't supported in Fish and Xonsh. The install guide has a separate section for Fish

Just did a few tests and looks like

/bin/bash -c "$(curl --proto '=https' --tlsv1.2 -sSf https://setup.atuin.sh)"

does function the same way (wrt interactivity etc) on a few platforms

@akinomyoga
Copy link
Contributor

Ah, OK. I now understand the issue. I'm sorry, but please forget about my comment above!

I'm not sure for Xonsh, but another solution is to use

curl --proto '=https' --tlsv1.2 -sSf https://setup.atuin.sh | bash

@ellie
Copy link
Member

ellie commented Jan 31, 2024

Hm, perhaps. I think /bin/bash -c is more likely to work on more systems/shells though, without relying on POSIX

In any case, I've updated atuin.sh! Thanks for the input everyone

@ellie ellie closed this as completed Jan 31, 2024
@anki-code
Copy link
Author

Thanks @ellie !

@arcuru
Copy link
Contributor

arcuru commented Jan 31, 2024

Shouldn't it just be bash instead of /bin/bash? Bash doesn't necessarily have a required location, yes it's usually there but it's probably better to trust the users $PATH instead of hardcoding a location , that's why #!/usr/bin/env bash is the standard shebang instead of #!/bin/bash

Obviously this is not too important though, since any user can easily remove that.

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

4 participants