News for hackers. Stuff that matters.
Re:The most useful thing in bash by StavrosK on Wednesday April 17, 2013 @02:50PM (#5566282)
That's why I use fish. Not only does it cycle like that by default, but it autocompletes entire commands, searches for the substring in the middle of words, looks better, is faster, etc etc.
Re:The most useful thing in bash by Osiris on Wednesday April 17, 2013 @06:46PM (#5567824)
I've been using Fish on my Mac for a while as well as some VPS' I have. At work I just installed it on our dev server.

It has a build in git status script you can include in your prompt that's awesome. Here's my fish prompt (note __fish_git_prompt):

    function fish_prompt
      set last_status $status

      set_color $fish_color_cwd
      printf '%s' (prompt_pwd)
      set_color normal

      printf '%s ' (__fish_git_prompt)

      set_color normal
    end
Sample:

   ~/G/Calendar (branch_name * ↩ =)
Re:The most useful thing in bash by kanemathers on Thursday April 18, 2013 @01:21AM (#5569030)
Re:The most useful thing in bash by johtso on Wednesday April 17, 2013 @04:40PM (#5567053)
You can also get the same functionality with ZSH using https://github.com/zsh-users/zsh-history-substring-search
Re:The most useful thing in bash by StavrosK on Wednesday April 17, 2013 @04:42PM (#5567067)
I tried oh-my-zsh for that, but it was very slow to start up. I went back to fish when I realized that I had basically set up zsh to act exactly like fish.
Re:The most useful thing in bash by nuclear_eclipse on Wednesday April 17, 2013 @07:13PM (#5567948)
I tried fish and went back to zsh when I realized that I was basically setting it up to be exactly like zsh. :P
Re:The most useful thing in bash by dsl on Wednesday April 17, 2013 @04:12PM (#5566844)
I am really amazed more people on HN aren't using fish. Everyone should check it out: http://ridiculousfish.com/shell/
Re:The most useful thing in bash by jfb on Wednesday April 17, 2013 @04:45PM (#5567089)
It's unfortunately on the one hand too beholden to POSIX shell behavior, while still being too different from mainline Bourne derivatives. I've tried it a few times, and the cognitive load is too extreme for my 20+ yrs of POSIX brain-damage to work around.
Re:The most useful thing in bash by sourpoi on Wednesday April 17, 2013 @06:50PM (#5567846)
I don't use fish for shell scripting, but I'm enjoying it as my primary environment after making these adjustments..

Status codes and argument lists:

    $status  # replaces $?
    $argv    # replaces $@
Aliases are just functions (configure your startup in ~/.config/fish/config.fish):

    # alias ls="ls -lrth"
    function lr; ls -lrth $argv; end
For-loops are familiar:

    # for n in one two three; do echo $n; done
    for n in one two three; echo $n; end
The lack of '!$' confounded my hard-wired fingers until I settled on Alt-u to avoid up-arrows (see /usr/share/fish/functions/fish_default_key_bindings.fish):

    bind \eu history-token-search-backward  # replaces !$
    bind \ei history-token-search-forward   # bonus fun
The remaining price for fish's pseudo-telepathic assistance is the occasional frustration with applications that rely on the value of a user's default shell (/etc/passwd).
Re:The most useful thing in bash by Rovanion on Wednesday April 17, 2013 @04:40PM (#5567048)
Does it run bash scripts or does it have its own scripting language?
Re:The most useful thing in bash by dsl on Wednesday April 17, 2013 @04:55PM (#5567168)
Your script should have "#!/bin/bash" at the top, which tells the shell what interpreter you want it ran with. So, yes?
Re:The most useful thing in bash by etanol on Wednesday April 17, 2013 @06:00PM (#5567600)
It is the kernel the one that interprets shebangs, not the shell:

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.g...

Re:The most useful thing in bash by jcampbell1 on Wednesday April 17, 2013 @05:49PM (#5567521)
Thanks for the tip. I just installed it, and it seems really nice. The autocompletion of flags is pretty amazing.