Hacker News new | ask | show | jobs
by raverbashing 1031 days ago
Did you have to convert your scripts to fish? Or is there an automated way?
4 comments

Nobody (I know) that uses fish actually writes scripts in fish. Everyone writes scripts in bash for portability.
I’ve been writing all my shell scripts as .fish files for years. They’re just for me and I enjoy the syntax.
Same! I love the syntax, and I only share my .fish scripts with a friend or two I program with that also uses fish.
I’ve used fish for a half decade too, I still write my scripts in bash like everyone else. I want them to be standard and portable.

Longer scripts get the Python treatment or a Go application.

While there is a tool called `babelfish` that will automatically convert bash to fish, in practice it's rarely needed.

You can run bash scripts from fish.

For sourcing, often it makes sense to use direnv to automatically load variables. -- For "just source this one time", in the worst case you can run a bash shell, source that, then run a fish shell.

You can always run .sh scripts