Hacker News new | past | comments | ask | show | jobs | submit login

Oh god that just reminded me how often people ignore the question asking for posix shell or “/bin/sh” or other specific shell scripting language… and processed to answer the question using bash, zsh, Perl, python, or even the slightly less wrong (because it is kinda weird to be shell scripting without a moderately normal unix environment) of using a bunch of Unix binary programs to do the requested job without actually solving the core problem of the question, because the tools made it easier…

And then to ice the cake you find the question because your question has been marked as a duplicate of the older question where they answered using unix binary tools… and you specifically asked about doing something in “pure shell script” or something similar to that phrase.

Stack overflow is fundamentally a system design that breaks down at scale due to misalignment of incentives that are necessary for it to work well at smaller scales (as can be seen in the successful operation of various smaller Stack Exchange sites for various topics such as Law, Aviation, Physics, etc)




The bash not sh issue is due to ignorance on the part of the answerers not an XY problem. Also shell can"t do everything - you are in a POSIX environment so use POSIX tools. The Unix environment is an environment of putting together many small tools and not just using one so any shell script can call POSIX tools as a minimum. So just making a complex shell script rather than using the tools does need to explain why.

I must admit that I don"t buy in to that philosophy and like using one tool so for scripting I would do all in python, so I would not be answering that question.

Many Linux users think that their way is the only and that means bash as the shell and many others like GNU coreutils, gcc etc. I am an MacOS user and my professional career includes several non Linux Unixes so I know bash is not the only shell - try csh for fun - which is partly why I use python or previously perl as they are the same on all machines




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: