$'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
when using read, the following problems are encountered, which are not consistent with what you think. The code and results are as follows -sharp! bin bash IFS= read -d - var1 var2 <<< " 123 -" printf "%s n" "...
1. There is a text test.log, content that is: 1 an A 2 b B 3 c C 2. Execute while to get normal output cat test.log |while read item;do echo $item;done 1 an A 2 b B 3 c C 3. But executing while+awk loses the first line cat test.log |while r...
write a shell script that looks at the contents of the current directory and prints out the word "Directory " for all directories, followed by a comma-separated list of directory names and contents sorted by modification time, and all files print the wo...
1, if you use the linux that comes with win10 to ssh 1: 2, use cmd to ssh other ssh software can display normally, the picture is not posted, wsl local adjustment normal response far end is centos no usr bin resize Type stty cols xx stty...