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

This stuff is good to know -- I have found the "sed -e" trick and doing pattern matching inside awk help cut down on typing quite a bit. They may even make the script more readable, once you become familiar with these idioms.

On the other hand, I don't know if these type of performance optimizations will have many real-world applications. For example, if you are calling grep and awk inside a loop, and find it unacceptable slow, I don't think you are going to see a big performance gain by calling only awk. At that point, your best bet may be to write that part of your script in Perl (or C, like I did once back in the times before Perl was mainstream).



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: