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

Another example of why shell languages are insane interfaces. Only someone who works on writing shell scripts all day could keep in their head all the things like this that could go wrong and how to defend against them.


Sadly this is one of the sanest answers. ./* or always using -- are coping mechanisms. We've internalized the UNIX warts so hard that we no longer perceive them.

I've moved to writing scripts in python instead. It's horribly verbose, but at least it's predictable and doesn't require the use of noisy disclaimers on every call to defend against rare cases.

There's definitely a need for a terser sane scripting language, but I haven't found one yet.


I've started writing in Rust, and have a small function to pass a simple string to "/bin/sh -c"

I can avoid most of the pitfalls of writing in sh, while still being able to glue external programs together.

For the record, I'm only writing it in Rust because I enjoy it, not because "Rust is the one true way".




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

Search: