Live data from Hacker News

Fish shell 2.2

fishshell.com

21–30 of 73 posts

Re: Fish shell 2.2

#21
post #8

Earlier quoted context omitted.

How come your scripts don't work with #!/bin/bash ?

Yeah, I keep seeing this complaint come up. Interesting that so many people don't realize you can run bash scripts from another shell without fanfare.

We realize, we're just doing something different than you are.

Re: Fish shell 2.2

#22
post #11

i used fish 10 years ago. since then i use zsh. i am happy with zsh. but fish is a good shell. incredible it's still being developed.

Not so sure about the "still". There was a fork and a change of developers somewhere along those 10 years.

Re: Fish shell 2.2

#24
post #19

Earlier quoted context omitted.

> its not compatible with BASH's shell scripting, which means you often cant just run shell scripts written by others, you may have to reformat it a little first. What exactly do you mean by “Shell scripts”? If the script contains a proper Shebang you can easily run it via `./script.sh`. If not you use: `bash ./script.sh`.

I have several bash functions that need to be sourced to be included. For instance, I use `cdc` to change to my code directory, where I keep my source for projects I am working on. If I type `cdc name` it changes it to my projects source directory, save me a lot of keystrokes in a day as I have many that I flip between. This sourcing of a function is required due to the way cd is handled, and in it's current form, no…

You want $CDPATH for that in Bash.

Re: Fish shell 2.2

#25
post #5

My main gripe with a shell like Fish is that it won't work with the trusted ol' BASH scripts. Seeing as I deal with quite some BASH scripts on a day-to-day basis at work this keeps me from trying it out, even though I'd love to be able to use something more sophisticated/evolved than plain BASH.

My main gripe with 'BASH scripts' is that in most cases they could simply be 'Shell scripts' and in most cases they call and require Bash for no reason at all ;)

Re: Fish shell 2.2

#26
I use fish exclusively and swear by it. I switched to zsh some years ago and enabled fish emulation, but it was slower, and I realized all I was doing was using fish by proxy, so I switched back to fish.

It's fantastic, I urge everyone to give it a try. Pretty much the only valid complaint I see here is from people who have bash code that needs to be sourced to run. I definitely think that it's worth rewriting some code to switch to a much superior shell, though.

Re: Fish shell 2.2

#27
Fish shell is awesome. But yes, compatibility of sourced functions was a bit of a problem for me. After about a year with it, I switched back to zsh. With a couple plugins I was able to get much of the fish features out it, while keeping the bash compatibility. Here is how I do it.

Install oh-my-zsh, and enable I couple plugins. Here's what I have in my config: plugins=(git history-substring-search zsh-syntax-highlighting docker sudo)

In terms of 'enjoying the same setup on all devices', I use dropbox (or owncloud), to sync my config. All I have to do is add this at the bottom of my .zshrc file: source ~/Dropbox/global.zshrc

My last tip about directory jumping, for keedot, is there are methods that will do this for you. I use fasd (https://github.com/clvv/fasd) which you can add to your shell and will remember the directories you use often so you dont have to make special cases for specific ones. Check out the 'z' command. It has been amazingly useful.

Re: Fish shell 2.2

#28
post #8

Earlier quoted context omitted.

How come your scripts don't work with #!/bin/bash ?

Yeah, I keep seeing this complaint come up. Interesting that so many people don't realize you can run bash scripts from another shell without fanfare.

There's just a couple tricky ones in these scenarios.

For me, there's virtualenv and rvm that both mess with shell stuff deeply enough to where running them in fish can be tricky.

virtualenv has good fish support, but never really got rvm working. I ended up going back to zsh after 2 years or so in fish because of small issues like that and realising that so long as I had reverse search I wasn't really gaining much in productivity from fish.

Re: Fish shell 2.2

#29
post #28

Earlier quoted context omitted.

Yeah, I keep seeing this complaint come up. Interesting that so many people don't realize you can run bash scripts from another shell without fanfare.

There's just a couple tricky ones in these scenarios. For me, there's virtualenv and rvm that both mess with shell stuff deeply enough to where running them in fish can be tricky. virtualenv has good fish support, but never really got rvm working. I ended up going back to zsh after 2 years or so in fish because of small issues like that and realising that so long as I had reverse search I wasn't really gaining much i…

rbenv has good fish support out of the box if you're willing to switch from rvm:

https://github.com/sstephenson/rbenv

Re: Fish shell 2.2

#30
post #5

My main gripe with a shell like Fish is that it won't work with the trusted ol' BASH scripts. Seeing as I deal with quite some BASH scripts on a day-to-day basis at work this keeps me from trying it out, even though I'd love to be able to use something more sophisticated/evolved than plain BASH.

What I do is configure my terminal emulators to use fish but leave bash as my system shell.
Post reply on HN