Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

This question already has an answer here:

I found examples of different quoting for curly braces for find, but I could not find an explanation. The possible choices are:
1. {}
2. '{}'
3. "{}"
And they all seem to work fine. Is there a difference between them?

share|improve this question
add comment

marked as duplicate by Gilles, Stéphane Gimenez, uther, jasonwryan, manatwork Mar 22 '13 at 6:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 2 down vote accepted

The quoting would only be required if {} was interpreted by the shell. No modern shell (that I am aware of) interprets {} any way other than literally. In bash and ksh93, {} indicates a brace expansion, but since {} is an empty brace expansion, it isn't interpreted. In POSIX shell, it has no meaning, and so is also literal. I am not aware of it having any special meaning in the original Bourne shell, either.

Most likely this quoting is just people being cautious, and assuming { or } (or the two combined) may be interpreted as metacharacters by certain shells. In practise, I can't think of any shells that assign special meaning to it.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.