Re:fish-shell: the user-friendly command-line shell
by raverbashing on Saturday August 26, 2023 @10:08AM
(#37273088)
Did you have to convert your scripts to fish? Or is there an automated way?
[ Parent
| on HN ]
Re:fish-shell: the user-friendly command-line shell
by bin_bash on Saturday August 26, 2023 @10:27AM
(#37273232)
Nobody (I know) that uses fish actually writes scripts in fish. Everyone writes scripts in bash for portability.
Re:fish-shell: the user-friendly command-line shell
by prokopton on Saturday August 26, 2023 @11:09AM
(#37273567)
I’ve been writing all my shell scripts as .fish files for years. They’re just for me and I enjoy the syntax.
Re:fish-shell: the user-friendly command-line shell
by ModernCannabist on Saturday August 26, 2023 @12:31PM
(#37274292)
Same! I love the syntax, and I only share my .fish scripts with a friend or two I program with that also uses fish.
Re:fish-shell: the user-friendly command-line shell
by theshrike79 on Saturday August 26, 2023 @10:31AM
(#37273271)
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 an portable.
Longer scripts get the Python treatment or a Go application.
Re:fish-shell: the user-friendly command-line shell
by junon on Saturday August 26, 2023 @10:26AM
(#37273226)
You can always run .sh scripts
Re:fish-shell: the user-friendly command-line shell
by rgoulter on Saturday August 26, 2023 @10:46AM
(#37273382)
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.