Hacker News new | ask | show | jobs
by kytazo 1549 days ago
Just loving every single bit of it since I switched to it. Had a couple of thoughts of migrating to zsh mostly because its more POSIX compliant but it doesn't look like such a valid argument as time passes by
3 comments

I think POSIX compliance of interactive shells is completely irrelevant. POSIX shells are relevant when you're writing scripts that will be distributed, but there's no reason that needs to be done with the same shell you use interactively. I use fish presently and zsh before that for nearly 15 years, but my shell scripts have always started with #!/bin/sh

It's not like fish installs to /bin/sh, nor are /bin/sh scripts executed using fish just because your interactive shell is fish. I guess these are the two misconceptions the common worries are based on?

Same. I've been using fish forever. Scripts that use sh or bash still work fine.

The fish scripting language is much easier to read and write than bash (for someone that doesn't write many scripts). So for local scripts I use it but for anything shared it's still bash scripts.

Yeah I agree POSIX compliance is irrelevant in the interactive usage context, the only issue that rose here and there were command substitutions mostly, something which this release takes care of.

The sole reason I was contemplating switching to zsh in regards to POSIX was the fact my shell scripting knowledge is rather shallow and I could perhaps improve it a bit while working on functions I write for personal interactive use.. Needless to say I've written them in fish haha.. If my assumptions are right what I need to master is combining properly the coreutils and the general mentality of piping things from one command to another etc - I could be wrong tho

Same here, totally don’t get the whole compatibility argument. If I need to script anything of any complexity I use a more proper programming language anyway such as Python, Ruby, Julia or maybe even Go as it makes distributing apps/scripts real easy.
I made the mistake last year of falling in love with xs-shell https://github.com/TieDyedDevil/XS, talking to its maintainer (who recently put xs out to pasture, as it were) who is now moving all his stuff to es-shell, switching my romance to es-shell https://wryun.github.io/es-shell/, merging in 2 forks of it to my own version https://github.com/pmarreck/es-shell/ aaaand having a kid and basically running out of time.

This shell makes a ton more sense to my brain than the usual bash/zsh/fish rigmarole, it just needs some love. It's older, but basically much smarter.

The last thing I was working on was a way to capture all of stdout, stderr and return code from a single run of a command, for testing purposes, because the OTHER thing es-shell desperately needs is a proper test suite, and being able to assert on all/any of those side-effects (and the return value) is IMHO fundamental to a proper suite. I figured one out for bash https://github.com/pmarreck/tinytestlib but not one for es yet.

Sorry for hijacking your comment

Yay, another es shell user!
All 10 of us should get together sometime!

Honestly, how does this shell not have more attention?!?!

Es global meetup 2022! I'm down. BYOW.
My company has default shell as zsh so every tool assumes that. How can I switch to fish in such an environment?
Isn’t the first line a shebang that would tell which she’ll to run it with?

`#! /usr/bin/env zsh`

You can execute zsh scripts from a fish command line, or any other. Where is the problem?
Fish doesn't source /etc/profile{,.d}, so it won't pickup additional PATHs and other env vars that packages set there, for example.

A workaround is launching it from .bashrc/.zshrc or terminal. https://wiki.archlinux.org/title/Fish#Setting_fish_as_intera...

Here’s some solutions, I’ve written a few scripts for projects to pass aws okta tokens. Absolutely worth it to use fish IME. YMMV depending on complexity https://superuser.com/questions/446925/re-use-profile-for-fi...
Doesn’t sound like it would really be worth it. Zsh is at least better than bash.
There should be no issue. Just execute scripts with zsh if it isn't compatible. Inside fish you could just do the following: $ zsh ./script.sh