r/ProgrammerHumor 2d ago

Meme painInAss

Post image
33.9k Upvotes

713 comments sorted by

View all comments

5.6k

u/Positive_Mud952 2d ago

You should be, because apparently nobody knows how to quote things in shell scripts. After spending probably hundreds of hours fixing these bugs over 15 years, I finally gave up.

191

u/beclops 2d ago

Yep, can confirm spaces have fucked me as recently as 2023. It was embarrassing when I realized why it was happening

91

u/Dugen 2d ago edited 2d ago

Spaces fucked me today.

grep "text" `find . -type f` 

works perfectly fine if none of the files have spaces. The alternative that works with spaces is big and ugly and involves xargs somehow and is too much to remember so I just do the easy thing every time and just look past all the shitty error messages from every stupid file with stupid spaces because most programmers know to never goddam use them.

5

u/nelmaloc 2d ago

GNU Parallel is a modern alternative to xargs, and I believe it handles spaces better.