5 msΒ·
π Fish rocks. I've been using it exclusively for the last year, and I can't imagine giving it up. There seem to be a number of misconceptions, which I will en
by SnowLprd 13y ago
π Fish rocks. I've been using it exclusively for the last year, and I can't imagine giving it up.
There seem to be a number of misconceptions, which I will endeavor to address. The first is: "Fish isn't POSIX/bash-compliant, so there are compatibility problems." POSIX non-compliance is a feature, not a disadvantage, of the fish shell. It means there is less legacy baggage and syntactical inconsistency. I can count the number of POSIX/bash compliance-related issues I've had with fish on one hand, all of which were easily dealt with. For example, Vim assumes that your shell is sh compatible, but adding set shell=sh in your .vimrc solves that. The only other significant one for me was virtualenvwrapper, which doesn't support fish. Not a problem: Virtualfish solves that handily: https://github.com/adambrenecki/virtualfish https://github.com/adambrenecki/virtualfish
Want to run a bash script? Just run bash fooshnizzle.sh. Want to switch to bash for a moment? Run bash and then exit when you want to switch back to fish. This POSIX-compatibility topic is, in my opinion, much ado about nothing.
Another misunderstanding seems to be, "I can do XYZ in bash, but fish doesn't support that." Fish purposefully limits the number of "builtins" -- commands that fish includes by default -- in order to maintain simplicity. For me, that's a feature. When I find that there's something I want to be easier to do in fish, I whip up a tiny function to do it. Not only is that extremely easy to do in fish, but then that command performs precisely the way I want it to. I haven't pushed many of those to my dotfile repository yet, but you can check out some of my fish functions there: https://github.com/justinmayer/dotfiles/tree/master/fish https://github.com/justinmayer/dotfiles/tree/master/fish
Fish is fast, the auto-completion is amazingly helpful, and it's intuitive to use without too much configuration. Give it a try. π
- mixmastamyk 13y agoI use fish. I write short scripts in bash and longer ones in Python for portability. Everyone's happy... posix has never come up.
- jlgreco 13y ago> Want to run a bash script? Just run bash fooshnizzle.sh Why not just #!/usr/bin/env bash ? In zsh I never worry about running bash scripts because they run by the kernel with the shell/interpreter specified after the hashbag.
- SnowLprd 13y agoSame thing in fish. Either way works just fine.
- sliverstorm 13y agoI just wish it didn't insist on doing everything differently. For example, PATH is traditionally delimited with colons in just about every shell; fish uses spaces. This instantly breaks compatibility with legacy environment configuration, and for no particularly good reason that I can see. I was excited to try fish, but I found it impossible to get configured in an established environment with entrenched bash usage (which zsh, by the way, has no problem with)
- ridiculous_fish 13y agoDo you mind sharing more details about your legacy environment configuration? How are you currently setting $PATH? Usually the differences in syntax for setting variables causes more problems than the colons. Regarding $PATH: it is actually not delimited at all in fish. Instead, $PATH is an array, which is a first class notion in fish. This allows for nice tricks like, say, looping through $PATH: for dir in $PATH echo $dir end or deleting its last entry: set --erase PATH[-1] Of course, fish flattens $PATH into a colon-delimited string when setting it as an environment variable, and unflattens it when reading it from the environment.
- sliverstorm 13y agoPATH gets set the way it always did. For example in bash: export PATH=$PATH:<new_dir> As for the larger question of environment configuration; we pull in a number of shell configuration scripts owned by the infrastructure teams. You are right, there is no universal way to set path due to things like "export" vs "setenv", but often multiple shells support the same syntax so you can sometimes use a config script meant for bash in zsh, for example. I had hoped that fish would be able to use csh scripts, because it shares "setenv", but csh of course delimits PATH with colons. You say that PATH is treated as a colon-delimited string when accessed as an environment variable... Hmm. That wasn't what I was seeing, but it is entirely possible I made a mess of things, or that I broke things when I compiled it. Anyway, it's unlikely I personally will be able to use fish. I hit many more obstacles than just PATH, but that was the easiest example and I thought I'd share some feedback.
- Paul_D_Santana 13y agoπ Where did you get that fish? And are there more animal characters? I'm surprised I can copy it into other apps and it doesn't bug out. π