News for hackers. Stuff that matters.
Re:Zsh is your friend. by crazydiamond on Wednesday February 01, 2012 @12:50AM (#3536882)
I tried out fish a month back, but got stuck on 2 things, one which i use frequently.

1. I use the Alt-. (dot) to get last argument of previous command.

2. Getting output of previous command such as : `!!` (backtick !! backtick) for which I get a "no such file".

I asked on reddit, but got no replies. Thx.

Re:Zsh is your friend. by bellbind on Wednesday February 01, 2012 @07:48AM (#3537696)
!! is not specific to fish. It is a history feature to get the last command. It's like using '!ec' for getting the last command that starts with 'ec'. Using `!!` is not "getting output of previous command", it is re-executing it and getting that output.

For that alt+. tip, I'd use the special $_ var.

Re:Zsh is your friend. by crazydiamond on Wednesday February 01, 2012 @11:54PM (#3541486)
You haven't told me how to do a `!!` in fish. (I do understand that it re-executes the previous command). I am used to using this in other shells like bash and zsh, and would like to know if there's some way of doing it in fish.
Re:Zsh is your friend. by bellbind on Thursday February 02, 2012 @03:07AM (#3541912)
AFAIK this is not possible with fish, as variables cannot be used as commands like in bash (and the ! history feature does not exist in fish, it is designed to be fully interactive).

See http://fishshell.com/user_doc/faq.html#faq-history