Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

(author here) Yes, I actually proposed that in the comments [1]. Some should add command_sub_errexit to bash:

    echo $(date %x)  # can you tell what's wrong here?
    echo 'script should fail before this'

    local d=$(date %x)
    echo 'script should fail before this'
And process_sub_fail:

    diff <(sort left.txt) <(sort /oops/error)
    echo 'script should fail before this'
As mentioned in the comment, bash doesn't even wait() on process subs!

The 'run' builtin to fix the "if myfunc" problem should also be adopted by other shells.

POSIX basically calcified broken language semantics and needs to be fixed.

I also document stuff like shopt -s simple_word_eval for other shell implementers: https://www.oilshell.org/release/0.8.3/doc/simple-word-eval....

-----

BTW Oil's code is very short (see comment), and I'm looking for help :) Let me know if you can't get a bin/osh working in 1 to 5 minutes. (If you have a Debian/Ubuntu-ish machine it should take about 1 minute.)

This is a pure Python program that you can quickly modify/prototype, and then for the release it's translated into C++ for a 30-50x speedup [2].

https://github.com/oilshell/oil/wiki/Contributing

[1] https://lobste.rs/s/qfiki1/four_features_justify_new_unix_sh...

[2] http://www.oilshell.org/blog/2020/01/parser-benchmarks.html



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: