News for hackers. Stuff that matters.
Re:Fish shell by barosl on Monday May 18, 2015 @05:24PM (#9566953)
I definitely recommend fish to every newcomer to Unix. It has sane defaults, colorful output, and so many features that work out of the box.

That said, there is a long-standing issue regarding inline environment variables.[1] Briefly speaking, fish does not recognize the `NAME=value command` form. So you should use `env` to work around this. This may not be a deal breaker, but I'm a bit annoyed, and migrated to zsh.

I would call zsh the opposite to fish. It has insane defaults, is highly customizable, and has so many features that are initially disabled. After hours of configuring it, I loved it.[2] Since then whenever I set up a new Unix machine zsh has been the first thing to install.

So, I would recommend zsh for the people who are used to Unix. If not, or you don't bother to customize it, there's always fish. There is no place for bash.

[1] https://github.com/fish-shell/fish-shell/issues/438

[2] https://github.com/barosl/baroslized-settings/blob/master/.z...

Re:Fish shell by nilved on Monday May 18, 2015 @05:27PM (#9566964)
Using `env` is very much a feature, not a bug. It's part of fish's philosophy to use programs rather than builtins wherever possible. It's good practice to use `env` even when using other shells.
Re:Fish shell by AceJohnny2 on Monday May 18, 2015 @05:47PM (#9567045)
> It has insane defaults, is highly customizable, and has so many features that are initially disabled.

Ah yes, the Emacs and Vim school of configuration.

Re:Fish shell by themodelplumber on Monday May 18, 2015 @05:38PM (#9567009)
Fish is great. I used it for a couple of years, right up until I had to install a software system that made extensive use of bash scripts that were incompatible with it. At the time I was in too much of a hurry to figure out how to tell the software to explicitly use bash, or something along those lines.
Re:Fish shell by ufo on Monday May 18, 2015 @06:03PM (#9567119)
As a rule of thumb you should make fish the default shell for your terminal emulator and leave bash as the login shell. This will let all the system configuration scripts work just fine.

The only time when POSIX incompatibility still hurts is if your workflow requires you to be source shell snippets.

Re:Fish shell by eridius on Monday May 18, 2015 @05:42PM (#9567025)
Why would a software system that relies on bash not explicitly use bash for its scripts?
Re:Fish shell by nilved on Monday May 18, 2015 @06:08PM (#9567133)
Bad developers. For example, I used Arch Linux for a number of years, where `/bin/sh` is a symlink to bash. Switching that to point to `dash` broke a number of programs both in the official repositories and the AUR. A lot of shell scripters can't spot a bashism, and just as many don't know that other shell syntax even exists.
Re:Fish shell by eridius on Monday May 18, 2015 @06:20PM (#9567182)
That's a different problem, though. /bin/sh must point to a sh-compatible shell. fish is not a sh-compatible shell. Therefore, any script using /bin/sh will never attempt to run as fish (as /bin/sh will never point to fish).

The reason I'm having a hard time imagining how a scripting system that relies on bash would fail with fish is because I can't imagine how one would actually write a script that is executed with the user's login shell. There's no #! line that would do that by accident.

Re:Fish shell by rquirk on Tuesday May 19, 2015 @07:42AM (#9569294)
There's just one scenario: a completely absent #! line.

It's an easy fix, just add the line, otherwise 0755 scripts with no #! do execute using the current shell.

Re:Fish shell by eridius on Tuesday May 19, 2015 @02:49PM (#9572247)
That doesn't work for me (in Fish).

  > cat foo
  echo wat
  > ./foo
  Failed to execute process './foo'. Reason:
  exec: Exec format error
  The file './foo' is marked as an executable but could not be run by the operating system.
It does however work in Bash. So this appears to be a bash-ism, rather than an OS feature.
Re:Fish shell by rquirk on Wednesday May 20, 2015 @11:32AM (#9576978)
Ah, bummer. I tested in csh too but not fish.
Re:Fish shell by oldmanjay on Monday May 18, 2015 @08:29PM (#9567597)
More likely, and somewhat less judgmentally, developers that are ignorant of the distinction.

Unless you want to define "bad" as "ignorant of some facet of computing" in which case we all fit.

Re:Fish shell by nilved on Monday May 18, 2015 @08:59PM (#9567670)
I can't think of any other definition of "bad" when it comes to programming. But I do appreciate your sentiment and realize I was being unjustly negative.
Re:Fish shell by ddoolin on Monday May 18, 2015 @05:29PM (#9566974)
Just to add to the first line, it also seems fairly well-commented in the code, at least the couple pieces I've looked at. This is really good for me as I often check the source first and helpful (or any) commenting is quite rare.
Re:Fish shell by diminishedprime on Tuesday May 19, 2015 @07:31AM (#9569242)
>There is no place for bash.

Just curious, why do you say this? I've used bash for years for basic command line things and now it sounds like I've been missing out on great features that other shells have.

Re:Fish shell by barosl on Tuesday May 19, 2015 @08:16AM (#9569458)
Sorry if my words were too strong. I said that because I like tools that do a particular job well. bash might be a middle ground tool that has moderately sane defaults and features. However, in other words, bash is inferior to fish with regard to easiness, and is worse than zsh with regard to feature set. I'm not a fan of such a tool.

I believe the world could have been a better place if they adopted fish as a default shell.

Re:Fish shell by diminishedprime on Tuesday May 19, 2015 @08:42AM (#9569589)
Interesting. I'll have to give both of those a try.