Live data from Hacker News

Show HN: Bish – Shell scripting with a modern feel

github.com

41–44 of 44 posts

Re: Show HN: Bish – Shell scripting with a modern feel

#41
A definite case of http://xkcd.com/927/

If you want to replace bash (in an environment where Perl, Python, and Ruby all exist in a space for more advanced scripting) you have to do a hell of a lot to improve on the existing standards.

Then again, a fun weekend project playing with compilers is a valid use of one's time, even if the product doesn't change the world forever :)

Re: Show HN: Bish – Shell scripting with a modern feel

#43

Earlier quoted context omitted.

I'm with you. I have written a mountain of Bash scripts to solve various one-off problems, and I'm fucked if I can ever remember the nuances from one time to the next -- when to use [], when [[]], when () or (()), when the dollar sign precedes (), etc. Every single time I have to do anything in Bash I have to re-learn Bash. I suppose I keep using it because, even with having to re-learn every single element of Bash c…

My dotfiles[1,2] are full of various functions to do stuff. Half of them I jacked from other people[3] when I was using Bash and ported to ZSH when I discovered Oh-my-zsh. However, a few are my own. The ones that I did write are often one-liners that take an argument and pass it to a series of commands that I'd rather not type. For example history | grep -i command, ls -lah | grep dir, or my favorite, cd dir; ls. If…

You seem like the kind of person who'd appreciate Percol[1]. It's fantastic for shell history. I have it bound to Ctrl+R:

    history | percol --prompt-bottom --result-bottom-up
I'm using fish, so the whole thing looks like this:

    function _percol_key_bindings

            function __percol_ctrl_r
                    set tempfile (mktemp)
                    history | percol --prompt-bottom --result-bottom-up >$tempfile
                    and commandline (cat $tempfile)
                    commandline -f repaint
                    rm -f $tempfile
            end

            # Bind Ctrl+R to percol history function for now
            bind \cr '__percol_ctrl_r'
    end
[1]https://github.com/mooz/percol/

Re: Show HN: Bish – Shell scripting with a modern feel

#44
post #13

For a long time I couldn't figure out why moving from bash to Python felt like such a big leap, and it was quite frustrating (path manipulation is particularly difficult). Recently I discovered a post [1] which touches on this: > The whole point of short code is saving human bandwidth, which is the single thing in a computing environment that doesn't obey Moore's law and doesn't double once in 18 months. Now, which k…

The semantic value of that punctuation is primarily for readibility and comprehensibility, then, where human bandwidth is way more limited. Achieving this goal is much more critical than reducing keystrokes, IMO. "Code is for humans to read, execution is an afterthought" or whatever the famous quote is. This isn't simply included to achieve a "modern feel".

IIRC Brian Kernighan said that. And the Kernighan & Pike book regards the shell, not C, as the primary language of Unix.
Post reply on HN