Hacker News new | ask | show | jobs
by throwaway290 1150 days ago
Ah. I meant cases where lazy third-party scripts just assume my current shell is POSIX and don't explicitly make themselves run in bash.
2 comments

Run "bash thirdparty.sh" instead of "./thirdparty.sh" to force bash.
if there is a bash script that does not start with #!/bin/bash where the instructions say to run it in bash, then it can be run as bash scriptfile; or cat scriptfile | bash;. both these forms work from any commandline shell
Yes. But I need to inspect the script to know to do it (or hope that if it didn't fail then it truly didn't fail). I am not saying it's an insurmountable challenge, just that there is some friction when using fish.
not really, unless there is a clear indication that it is a fish script, i's just asume it is bash and run it with that.

it's only work if the commands need to be run within fish itself and not a subshell. there are tools for that but i agree that sometimes i can't be bothered and then i'll just work in bash to do that job.

For example if I follow some README I may not even know whether it's a script or binary, so I guess I would need to know at least that before I run something with bash (or get "cannot execute binary":)