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

Every so often, I'll find myself frustrated with some bash script. For me, once a shell script gets to that point, it's best to rewrite it in Python. Translating a script into Python is almost fun, and I find the result much more maintainable. BTW, the original submission is great. I've written shell scripts over the years that have made this very mistake! For example doing something like:

   ls pj* | wc -l
Which normally returns the number of pj* files, but will fail for pathological file names as the submission points out.


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

Search: