How to add 27 esc characters to a makefile ?

In text form, I could not get the commands to work properly. I would like to find a way to insert 27 code text. If that doesn't work, I would prefer an insert with mc .

An example, color is inserted here:

sed "s/error:/^[1;31merror:^[0m/g" dist/out; 

^ - 27 characters.



    2 answers 2

    An example, color is inserted here: sed "s / error: / ^ [1; 31merror: ^ [0m / g" dist / out;

    if you need to enter instead of the ^ symbol a symbol with a code (decimal) 27 or (hexadecimal) 1b , then in this case you can do this using the \xab notation (where ab is a hexadecimal code):

     sed "s/error:/\x1b[1;31merror:\x1b[0m/g" dist/out; 

      Try writing \e[1;31 , etc.

      • It does not work. Basically, I wrote the 27 character at the end of the file with echo -e "\ e" >> ./Makefile and copied it into mc where appropriate. The option works, but the characters after ESC do not correspond to their position. I want a better option. - mikelsv
      • And so: \ 033 [1: 31m - skegg
      • Also no. Don't you have an extra makefile on hand? It would be easier to try it. - mikelsv