logoalt Hacker News

riddleytoday at 12:18 AM1 replyview on HN

>grep -R "error" logs

Why is error in quotes?


Replies

hronecviktortoday at 12:28 AM

These are all courtesy of AI of course.

Still, I may be a little anal about this but I align with this. I quote everything in bash. In this case I would do single quotes as it's a literal. You never know when someone with lesser bash knowledge will modify your script and put a variable in there. Shell expansions are nothing but footguns everywhere. Proper quoting hygiene and `--` goes a long way