[1] "Redirect stderr to stdout and pipe doesn't work as expected" https://github.com/fish-shell/fish-shell/issues/110
paste <(hquery -q '//a/@href' x) <(hquery -q '//a' x)
Where hquery is one of my utilities for running xpath queries over loosely parsed HTML. This would produce a tab-delimited list of link urls to link text. paste (hquery -q '//a/@href' x | psub) (hquery -q '//a' x | psub)
http://ridiculousfish.com/shell/user_doc/html/commands.html#...Here's my fish config if you want to see an example: https://bitbucket.org/sjl/dotfiles/src/tip/fish/config.fish
112 function hey_virtualbox_shut_down_or_i_will_fucking_cut_you
113 VBoxManage controlvm $argv poweroff
114 endhttp://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/sbin/sh...
function fish_user_keybindings
jesus_fucking_christ_bind_the_fucking_keys_fish
endAs you'll see, I like the way Fish automatically loads functions from, "$HOME/.config/fish/functions/". It keeps my config.fish file pretty lean.
https://news.ycombinator.com/item?id=5723235
https://news.ycombinator.com/item?id=5567639
https://news.ycombinator.com/item?id=4073162One of my main commandline utilities is git in combination with git-flow(amazing). I found the normal git completion lacking. I believe branches didn't get completed correctly in combination with some commands. The git-flow completion was non existent.
When that changes I might try it again. But for a shell that has tabcompletion as a selling point I was very unimpressed.
However, it seems like Fish is not fully POSIX-compatible, therefore you can face weird problems in Vim plugins, for example.
For people that exploit redirection, file handle rewiring, here docs and such... consider zsh with https://github.com/sorin-ionescu/prezto
A few things stand out to me as huge pluses:
- It has a lot of cool functionality out of the box such as highlighting, smarter autocomplete (type in a partial word at the prompt and hit up instead of the cumbersome bash ctrl r/s history prompt that loves to beep at you), directory history (alt left-arrow and alt right-arrow), and more.
- You don't need a 10k .bashrc or 1k .zshrc to unlock most of that cool functionality, it's just enabled by default. So anywhere you have fishshell installed, you get 95% of what you're used to, no need to git clone or scp over your .bashrc.
- Startup time is _very_ quick compared to bash or zsh with said 10k .bashrc or 1k .zshrc, and is comparable to bash or zdh with no startup file.
The only weird error I ever ran into was with an older version of fish shell complaining about missing directories in your PATH every time there was an automatic completion available. I have not run into that issue with newer releases.
It is not sh-compliant, which will occasionally wreck havoc when you have a program that shells out without explicitly using sh. I remember running into this issue specifically with vim and emacs on more than one occasion, but truth-be-told I consider this a bug with those programs rather than a fault with fish.
There's also the matter of it not being installed on some machines, but I've used bash for so many years now that my brain flips back into bash-mode anytime I see that familiar colorless prompt with a dollar sign at the end.
It's not an essential upgrade. I also wouldn't bother using it for shell scripts either. But I'd say give it a boy scout try for interactive usage and see how you like it.
Be sure to try Fish 2.0 which is even much more awesome than the older version.
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'What I do is spawn fish at the end of my .zshrc that way I can just exit if I run into something that doesn't work with fish.
The biggest plus for me is that the default auto complete in fish is twice as smart as the other ones.
Of course I'm also very new to bash/cli so I'm just happy if I can get things done and haven't yet gotten to the stage where I'm worrying about if it's the proper way to go about doing things.
set foo this that "the other"
then echo $faux; echo $faux[1]
doesn't produce anything, but echo $foo[4]
gives me an error message that I can't just pipe to /dev/nullAlso, writing autocompletes for functions is both far simpler than in bash, but I'm also missing some of tools that bash provides.
It would be pretty amazing, considering the file resolution properties of ROS. I actually love it since I don't have to be in the same directory and it's easy to go through many projects.
Just curious what sort of work are you doing on ROS. Earlier this year I was working on simulation stuff in Gazebo.
I would like to know what is interesting about a world with one shell for every user?
https://github.com/bpinto/oh-my-fish
I tried to get started with both. For me fish was by far the easier & more friendly starter. For shell powerusers zsh might be offer more options and less pitfalls.
A few things I occasionally run into: You can't just paste somebodies setup instructions into your shell anymore (you can temporarily invoke bash for that though). And when writing setup instructions yourself, sh is still pretty much the standard. VirtualEnv generates an activate.fish out of the box - nice! I still occasionally type !grep by accident. And I do miss &&.
function import_bash_aliases --description 'bash aliases to .fish function files.'
for a in (cat ~/.bashrc | grep "^alias")
set aname (echo $a | grep -Eoe "[a-z0-9]+=" | sed 's/=//')
set command (echo $a | sed 's/^alias .*=//' \
| sed 's/^ *\'//' | sed 's/\' *$//' )
echo "Processing alias $aname as $command"
if test -f ~/.config/fish/functions/$aname.fish
echo Function $aname is already defined. Skipping...
else
alias $aname $command
funcsave $aname
end
end
endA replacement is easy enough though and is in my config here: https://github.com/dmotz/dotfiles/blob/master/functions/sudo...
Beyond a few other syntax incompatibilities, I've enjoyed using it.
Maybe if it was at least somewhat bash or POSIX compatible I would be on board, but the developers don't even seem to want to help us out in that regard.
Here's a presentation I gave to my local coder community on fish: http://www.youtube.com/watch?v=SWmKfb2jQhU
Now that's an odd slogan. Is it trying to make the point that the competition is even older? Appeal to old-school hackers? Subtly tell me that the project hasn't been updated in a while?