shell - Escape character confusing in sed command -


A common use that is to avoid sed 's / \\\. / \\\\\\\. ./g '
I completely confuse why so many \

/ \\\. /

Search for patterns.

By default, the following is the escape sequence and dot means "any four", so \. Escape slash (\\) is translated into resume format, followed by escape dot (\.)

/ \\\\\\\. Instead of ./

\\ 8 slash and 1 dot I 4 were already escaped from the slash for the same reason for the research pattern but the dot in the replacement pattern was mean dot Therefore there is no need to avoid it.

Another way to write it is to / [\] [.] / \\ \\\\ & amp; / for fun or / \ ([\] \) [.] / \ 1 \ 1 \ 1 & amp; / LE


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -