![]() ![]() You might think you can escape the representation with an extra backslash \ - which ends up as \\x5b but while that "passes" - it doesn't match anything as intended: $ cat chartest.txt | sed 's/\x1b\\x5b//g' | hexdump -C Sed: -e expression #1, char 13: Invalid regular expression Note that - while you can match the 0x1b with a literal format \x1b in sed, you CANNOT do the same for 0x5b, which represents the left square bracket [: $ cat chartest.txt | sed 's/\x1b\x5b//g' | hexdump -C ![]() It is visible that git here adds the sequence 0x1b 0x5b 0x4b before the line ending ( 0x0a). Remote: Current branch master is up to date.\x1b[K" > chartest.txt Just a note let's say you have a file like this (such line endings are generated by git remote reports): echo -e "remote: * 27625a8 (HEAD, master) 1st git commit\x1b[K ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |