When I began using *nix 7 years ago (I have started with Ubuntu, now switched to Arch Linux) my default shell was bash. I don't even know at the beginning that there are others shells. As I has been getting better and better in working with CLI I've started thinking how to get even better and how to make my work easier. Then I found zsh. It is quite awesome. Has a lot of impressive stuff like:

  • spell checking
  • case-independent suggestions
  • is more customizable
  • is POSIX compatible
  • and has a lot more great stuff

But after that I on some screencast (to be specify this one) I have seen fish I get love in it. It isn't POSIX so I need get used to it, but now I cannot work without it. Why?

Syntax coloring

First impression began when you discover that fish is coloring commands as you input. It look awesome and also is great help when you make a typo. You can perfectly see where it is.

Simpler syntax

When I was writing sh scripts I never remember how to write conditions and loops. It was quite hard for me to remember that I can or cannot write if and then in one line without semicolon. Also if is closed with fi, case with esac and for with... done, WUT?

Built-ins reduced to minimum

In bash and zsh we have enormous amount of built-ins: test, [[, regexps, arithmetic via $((...)), variable modification via ${var_name##.}, etc. In fish it was reduced to needed minimum. If we need to test something, we use [ command, compute some arithmetic expression - bc or dc, use regexp - grep, awk, sed, perl, etc. In bash it usually take a lot of time to run another process due it's design, but fish use threads for different processes (not time-wasting fork) so it is fast and you don't see any delay.

Variable is an array

In bash (and zsh) you have difference between scalar and vector (array) variables. The second one need to be enclosed in () and referencing to it's elements was quite ugly ${arr[0]}.

arr=(a b c)

Also for beginners it can be hard to remember that there cannot be any whitespace before and after assignment sign, so:

var=data # work well
var = data # doesn't work

Fish don't have scalars, everything is an one based array and one-element array can be treated as an scalar, also to set variable you use built-in command, not the assignment sign (which is quite confusing, but is more powerful than POSIX one).

set var some_value
set arr a b c

Booth above commands create local variable named by first argument, and containing the rest. As a good shell command, set has some flags that modify it's behaviour.

Easy configuration and awesome help

Fish is created to be friendly for developers. It work on 256-colour terminals with nice colours and has great documentation available through help command.


If you are not afraid of changes, and want to check something new and awesome - go fish :)