Fix some formatting issues in the invalid character exercise

This commit is contained in:
ezri 2024-10-07 01:05:26 +00:00
parent 3e341193d9
commit 84a99adbb8

View File

@ -10,8 +10,8 @@ The command to run is this:
where `^M` is the token inserted as stated above, rather than the literal characters `^` and `M`.
Another option would be to use `\\r`, the more traditional escape sequence for the carriage return character. However, escape sequences like this do not work in single-quoted strings in Bash, so to use this, you'd have to do the following instead:
Another option would be to use `\r`, the more traditional escape sequence for the carriage return character. However, escape sequences like this do not work in single-quoted strings in Bash, so to use this, you'd have to do the following instead:
`sed -i "s/\\r//g /path/to/file`
`sed -i "s/\r//g" /path/to/file`
I tend to avoid using double-quoted strings for `sed` commands, as generally you'd want the `\\` chracter available for regex tokens, and having to escape it every time you use it is annoying, hence why I'd prefer the first command in this circumstance.
I tend to avoid using double-quoted strings for `sed` commands, as generally you'd want the `\` chracter available for regex tokens, and having to escape it every time you use it is annoying, hence why I'd prefer the first command in this circumstance.