What is the role of the $symbol in the red circle in the picture below linux curl?

clipboard.png

Apr.07,2022

Strings in the form of
$'string' are specially handled. The string is expanded to string and the backslash and the following characters are replaced like the C language.

for example, the newline character \ n will be used as a newline character when $'\ n' is used, and '\ n' or "\ n" will be treated as a normal string. Try

.
[root@chengqm test]-sharp echo $'\n'


[root@chengqm test]-sharp echo '\n'
\n
[root@chengqm test]-sharp echo "\n"
\n

Bash escape character

Menu