Live data from Hacker News

Fish shell

fishshell.com

101–110 of 120 posts

Re: Fish shell

#101

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…

+1 for scripting.

I wrote so many more small scripts for myself. Since I didn't need to consult a syntax manual every, the friction was low.

Re: Fish shell

#102
post #95
post #68

Earlier quoted context omitted.

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

The && syntax was added in fish 3, released in 2018.

Re: Fish shell

#103
post #79

Earlier quoted context omitted.

About 98% of common POSIX shell usage is covered by fish, right down to identical syntax. (Not everything is.) Biggest tip for fish switchers: set fish as your terminal's shell instead of changing your login shell.

I just start fish from .bashrc: https://github.com/pkulak/dotfiles/blob/master/.bashrc

I did that, but this makes it far more difficult to use bash if you need to.

Re: Fish shell

#104

Nit: Fish Shell is a bit redundant, as Fish stands for "Friendly Interactive Shell". Now that's out of my system, fish is fantastic and made me realise importance of sensible defaults. I tried zsh but configuration took longer than I would have liked, and oh-my-zsh is too bloated to start instantly. Compared to that, I have practically 0 modifications in my Fish config, apart from few aliases. I don't use fish for mo…

a good friend of mine used to say NIC Card Card

Re: Fish shell

#106

My FISh setup: Fish + oh-my-fish + theme-bobthefish + powerline modified fonts One of Fish’s features I like the most is a per-directory command history stack, on top of the normal history stack.

> a per-directory command history stack I’ve used Fish for years and always suspected it offered command history by directory. Fish really “just works” so I never felt the urge to investigate and verify my suspicion.

It also seems to have a type of per-command history. As you begin to type the command, you can tab through and auto-complete other similar commands you’ve done.

Re: Fish shell

#107
post #70

Earlier quoted context omitted.

But one of the selling points of fish is (from their website, I am not a user) that it has sane scripting. That point appealed me most. If I continue have to use bash for scripting, I wonder what fish provides over zsh.

I think fish's syntax is cleaner, though as others have pointed out, the incompatibility is often not worth it. Even though it's "sane", I would say it's not "powerful". It's significantly less powerful than bash, e.g. there is a list of missing things here: https://github.com/pirate/fish-utils/blob/master/README.md The first one seems like one of the bigger issues: https://github.com/fish-shell/fish-shell/issues/159…

#159 kind of works with the `string collect` mechanism, although it is indeed not very obvious, compared to bash:

    set file_contents (cat filename | string collect -N)
I understand that this is purely anecdotal, but I'm using fish for quite a long time, I've written a lot of tooling for myself in fish, and I agree that sometimes there are some things which are annoyingly missing from fish (like this multiline variable thing), but I would not say it makes fish significantly less powerful. And these things are sometimes fixed, too.

Re: Fish shell

#109
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…

> So the massive drawback of fish is it's incompatible with bash (and other shells people use). This drawback is also its advantage, as it doesn't need to repeat all the Bourne-ish problems. (You seem to like this :-), just pointing it out for the others.) I think people who are interested in how they use the command line will not have a problem to learn two shells, fish for the personal use and something Bourne-ish…

The Bourne shell certainly has problems, but IMHO fish should have stuck with POSIX syntax when it's "good enough" (TM). Stuff like $(code) vs (code) makes Fish feel like it just wants to be different.

Things I think are big problems:

* Needing to quote practically everything

* Needing to remember if/fi, case/esac, while/do/done, for/in/do/done, etc.

Re: Fish shell

#110
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.

Piping and redirects seem to just work, command substitution is always just parentheses with no $ in front. Process substitution is not magic syntax like in sh, it's just a command that reads from stdin, writes to a temporary file, and outputs the path to that file:

vim (ls -lh | psub)

Post reply on HN