Live data from Hacker News

Fish shell

fishshell.com

91–100 of 120 posts

Re: Fish shell

#91
I've been using fish for about seven or so years now. I've read a lot of people complain about the POSIX incompatibilities, and while I agree that that used to be a relatively annoying issue at first, most of it is not a problem in newer versions of fish (missing && was annoying, for example).

The fact the syntax diverges from bash/zsh is IMO a great boon to fish. I've enjoyed writing fish scripts much more than zsh/bash scripts.

At work I write both for things that runs on dev machines, since I converted a lot of colleagues to fish, and writing the bash/zsh ones is usually not that much effort to write.

Sure, it's a bit of a maintenance burden in theory, but it's not become a problem in practice yet. A few times I had to wonder "how do I sensibly do this in bash/zsh" when it was pretty friction-less in fish, but it hasn't happened often.

Another thing regarding compatibility: I've never had it be a major problem when things _truly_ were incompatible, since as others in the thread mentioned, I could just do `bash`, run the script and then CTRL-C.

Re: Fish shell

#93
post #16

So the massive drawback of fish is it's incompatible with bash (and other shells people use). If you're in fish, this is easily remedied because almost every machine has bash too. However, you can't expect another machine to have fish. However, I just really like fish. I also live out of my own shell, and I don't spend much of my life remote-ing into other machines. When I do, my mind flips into bash just as easily a…

I really like this combo:

1) Use fish interactively, with quite a few aliases.

2) Write 3) Write > 10 line scripts in Python.

Re: Fish shell

#94

Earlier quoted context omitted.

what's the difference between the two for the non initiatives?

AFAIK, login shell can be thought of as the default shell anytime you start a shell. By default your terminal program uses that, but most terminals let you override that to be something else.

I still fail to see a significant difference. Been using fish as my shell for perhaps 15 years.

Perhaps not having to run chsh on a new machine, which I have to run -h on to remember how to use ever few years.

Re: Fish shell

#95
post #68
post #64

Earlier quoted context omitted.

I really don’t get this argument. In my shell I don’t type scripts on the prompt. I use fish most of the time as a shell, but I still write bash or even sh scripts, because fish is not installed on most systems. If you run a bash script from fish, it is still executed by bash (because of the shebang).

Even something like # only test if the build succeeds ./build.py && ./test.py didn't work in fish until recently. It used to be 'and' but they recently added && for compatibility. I think redirects and possibly pipelines work differently in fish too, although I don't remember the details. I type those on the command line frequently. I occasionally use loops as well, though when it gets big I do put it in a file.

It looks like all of these are the same

    echo hi > out.txt
    echo append >>  out.txt
    sort &1 | tee out.txt
   
But here docs don't work the same way:

   sort 
I don't really like the here doc syntax so I guess that is pretty good. The && issue is still there on my Ubuntu Bionic machine:

    fish: Unsupported use of '&&'. In fish, please use 'COMMAND; and COMMAND'.
ls && ls

Re: Fish shell

#96
Favorite feature of Fish shell is `abbr` abbreviate. Which expands the abbreviations after or allowing it to reveal the magic behind it, for screensharing/observability and for modification. I use it with --long-options too so the abbreviations are more self-documenting.

e.g. `abbr --add --universal -- gg 'git log --graph --oneline --all'`

Re: Fish shell

#97
post #16

So the massive drawback of fish is it's incompatible with bash (and other shells people use). If you're in fish, this is easily remedied because almost every machine has bash too. However, you can't expect another machine to have fish. However, I just really like fish. I also live out of my own shell, and I don't spend much of my life remote-ing into other machines. When I do, my mind flips into bash just as easily a…

If all you do is copy paste other people's bash command than sure, stick to bash. The 99% of the time you're doing that you can use fish.

Re: Fish shell

#98
post #16

So the massive drawback of fish is it's incompatible with bash (and other shells people use). If you're in fish, this is easily remedied because almost every machine has bash too. However, you can't expect another machine to have fish. However, I just really like fish. I also live out of my own shell, and I don't spend much of my life remote-ing into other machines. When I do, my mind flips into bash just as easily a…

There is no need to change `$SHELL` :-/ you can use Bass (https://github.com/edc/bass) to execute any bash script and it will apply the environment variables to the current fish environment.

Re: Fish shell

#99

Earlier quoted context omitted.

I think this warning is actually harmful: Years ago, I read this argument about fish and it turned me completely off using it. Only more recently have I really realised this never applied to 99% of my (most people's?) use-cases. The logical step many people miss is that shebangs make the compatibility of the user's shell largely irrelevant: the only real compatibility concerns are the bash version or `sh` aliasing on…

> Only more recently have I really realised this never applied to 99% of my (most people's?) use-cases. every time someone asks "how do i accomplish X task on the command line" (witness literally thousands of Stack Overflow posts like this) the answer is in bash. so, i say it applies to essentially every use case where you didn't already know how to do it. I love fish, but the fact that every answer to your questions…

I've been using Fish as my primary shell for years. The vast majority of the time those Stack Overflow answers written for Bash work as written in Fish with no changes.

Occasionally you'll need to write the command substitution or command chaining in a different way, but once you get over the initial learning curve this is easy and pretty mechanical.

Very rarely I find some command that just doesn't work in Fish, in those instances it's easy enough to open the bash shell or throw it into a script file.

Re: Fish shell

#100
I love Fish, I've found it super easy to write small helper utilites for working with virtualenvs or opening Sublime projects. The barrier to scripting is so low and the language so approachable that if I have an idea for a new function I'd like to write, I can get it working in < 10 minutes almost every time. +1 to all the comments about `abbr` for abbreviations, makes working with Git great since I can still tweak the command before if I need to before it runs, plus it helps me remember what the command actually is instead of just setting & forgetting like with an alias.
Post reply on HN