The pair “”
is called smart quotes. Similarly, your ’
in Couldn’t
is also a smart quote.
Those are unlike normal quotes in the sense that they're curly to differentiate the begin and end of the quoting part. They have no meaning in most (if not all) programming/scripting languages I know and are just the same as other Unicode characters.
So your first echo
doesn't actually have any quote and the command will receive those words as separate arguments. You can check that easily
$ for s in “Couldn’t delete hello.txt”; do echo $s; done
“Couldn’t
delete
hello.txt”
$ for s in 'Couldn’t delete hello.txt'; do echo $s; done
Couldn’t delete hello.txt
In fact your output is wrong (did you really copy paste it?) because there's no way smart quotes become normal quotes after echo
. The output should still be smart quote as in my example above
As you can see, the second case is a single string containing a Unicode character outside the ASCII range, so the quotes will be stripped by the shell
See What are curly quotes and can I use them in my code?
“
and”
are not quotes.rm
part is completely irrelevant here. It's all about theecho
part{ ...; }
must always end in semi-colon or a newline character.