Is it possible to separate STDOUT context by its colour? - bash

I'm using the output of the excellent package icdiff (https://github.com/jeffkaufman/icdiff) to check for differences between updated iterations of files. I'd like to parse out just the significant differences though. From the package --help I can't see any in-built options (and for full disclosure I've 'cross posted' at the github issues page to see if it can be added or I've missed something).
This has got me wondering whether a hacky solution might be to parse out the lines by their colour, since they are also colour coded by 'severity of difference'. Is this at all possible in bash? (Alternative approaches are welcome too!)
Here's a sample of the output (I can only think to add a picture here since the markup wouldnt show colour). I'd like to get just the lines where the whole line is solid red/green for instance. Excuse some of the screen wrapping, my monitor isn't wide enough and the text is small enough already.

with GNU Grep, for example
grep -Po $'\e\[31m\K.*(?=\e\[\d+m)'
to extract text in red,
\K to keep the left outside match, like a lookbehind
(?=..) lookahead assertion 0 length match

you can grep on the ANSI escape sequences, e.g. (with 31 for red):
grep '^[\[31m' # make the escape character (^[) by typing ctrl+v ESC
but you need to make sure your output stays colored if it is not sent to a terminal : (many programs will make their output B&W when output is not a terminal. - you can check it with less, which will show you the escape sequences)

Related

Is it possible to render or print bold or stylized text in the build log?

I used a bash function to print out manually echo'd messages in bold, but it renders as normal text in the build log.
Is it possible to render the text a different font style or color in order to make it stand out when reviewing logs?
Edit-
Per the request in the comment (thanks Sathi) what I tried to were two techniques outlined here: How does one output bold text in Bash?
The tput method fails because there is no terminal to interact with, while using echo -e '\033[1mYOUR_STRING\033[0m' renders normal text. I understand why both of these would not likely work as there is not a terminal. I thought perhaps there would be an escape sequence or some other method specifically for the cloud build logs as viewed in cloud build, but I haven't seen anything when searching.

iterm2 images not displaying inline

iTerm2 has a feature that can be used to display images in the terminal, see https://iterm2.com/documentation-images.html for documentation on the protocol.
I have been able to produce an image in the terminal by using the correct ASCII characters and encoding; this string (starts with ESC and ends with ^G)
]1337;File=inline=1:iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABQtJREFUeNrsVktoXVUUXef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dQxxNgX5hZ0pjqBGUgBouuUfp+knuxqFe8Z073Xmy7A0K5FmOZmyXk7nSOEcYJ32+Lp7rN6O7bvvivGqpZaRDY24XWFdra3eCxmRaZxRORzt0Tk9Y5TxXh3bFkSacZ9cGfgNTO/h7pfLlN1E7w7bZRQ9bIyCBq74SCtQj4QC5ILHUzVg96y4KWCUbvC6UQq+fIUncEnWbxp7XtiD9J1mfsXR9ynl40/cdjA36UDfUWKmhJ4wDEsatdyY2iKxRCu12pKGKqbK95HgovcbEskzygm62U7oBkJscH9ldKgfV8FS8nCDUuZPQVtfp8TtNYte/pG5JkqHTTZicTPLMbmmolIyTFFUm5+Llqyh392v2VOelvG6fXl5tPzBm2HWzf9tPS0eNNE8hZPPZg0bAyr3CDbOdL9uvZcrXFNyVXjkSlbgkVth+uZk3rndxZLePRiapUOQtilpwDgsmWnk9dcSPbx/A9u/ajV7S+VqExQ52plz0q6LYfAQNCJQpg7/+R7JygTdwkvjCzWDioVeqD08/LbfEMINyNv3ts33o0WrX/J4/X1xoHyRMzmrW0ppyrt0rT7On7rcwV+xls3ECjHsuxuLgg/xMG/HUVLn+bDHX/yb+7wH/EGAARjZ2jNWjuZgAAAAASUVORK5CYII=
will produce this output:
however, when I attempt to display another image along side, this happens; string
]1337;File=inline=1:iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABQtJREFUeNrsVktoXVUUXefc7/vmpUmaNonWSsFYtBZEWhRKERxI60QF6UhBOhAVEXEmzjrVQbXgTBRFB4oTlSq1FEGEiggWlKpVjG0wn9fXvE/u75zjOucmaVIrWhBB6IX9eO9+9tpr7bX3fcIYg//yENcB/33As+PX9oStr8GPvsClJ0dG1AXviIiKSYyJ1+SucFEI3KqXknFZHxpH7n0sW9Xj8UPjEA0Jk2j41wBU5+ejaOnH0NChansLmMjugB+MeDs0REsclGEC4ZHFuEAxPwOVNYfjA5PH5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F0IuB8wtN8q0A7OIuGixmcFtXiYTuH4EG4/O4tiJVdvTYX+PH+erXYSv0LYuxWb79e/6DfmylD+BJEcWAUzOVmZcg3VlQeM4XvUKMM3rQmP9KkhGSqjpLtYdnNnaHg73CWtflv2wXhrgkx4abjQUsAaVLQDiOEernUKw6N19MktHcrY/jUYzLZ5xgNWQc5wvGHSZmwxx3ek5Fc6n0J7c7wBX076mnV+qRJczgrCoXXS8YFKpMI46zdDtJDBstLZ/PxSmcKQAZa4dsFOYo1uPlTDRaWPs+CLSsr/D5fDE4PkhChoN5Ve87kjXygQC8qQoim6cFd77zJ97QHLvhU5eRBa4qB07BG3w3lBIH4gQmAxRN0anHOx1gD/Sau54EhU/EaFab6UZD0suMi523ote12E8CINeU3Cl4bqWE1NXZ6jywh1lmseK5JqhKhXsjpiAkVJQ1x1pvHtkq33RnYe9wMqsozP04vPpd0S8+IIcCVygvYgHFIzLCAkI5JTqyqffpIq0FHXr/lLvcDWq3Xrs5rGmd2GVYGfJDs6z43d28YipiFYeL6uSZaBLr5WuCThAF5WxvRkhBsTHGeGryZGvzIpyc93pNs/V/99L/+2AfwkwAIpSa6LlmvuQAAAAAElFTkSuQmCC
produces
The images are not inline.
How can I ensure consecutive images remain inline? I am able to repeat the result in zsh, and bash. I am on iTerm 2 Build 3.0.4.
Thanks!
There are two solutions:
1> Insert \b\33[1A at the beginning of the second and third image, change the count of \33[1A according to the height of image (in your case, it appears once). The meaning of escape sequences can be referenced here.
\e]1337;File=inline=1:iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABQtJREFUeNrsVktoXVUUXefc7/vmpUmaNonWSsFYtBZEWhRKERxI60QF6UhBOhAVEXEmzjrVQbXgTBRFB4oTlSq1FEGEiggWlKpVjG0wn9fXvE/u75zjOucmaVIrWhBB6IX9eO9+9tpr7bX3fcIYg//yENcB/33As+PX9oStr8GPvsClJ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Oo5G4a9rYNvunWtES6/JoyBeXhYP0x6/FDCnQiqhJCDzR3BNsVQjRSBVZNnRremBopobXY0kY40yWo9OepRhsrqOa7J2+cbvj0w2RkstYexFlb5Ju3tQMJYJBs6zEfhkqFQOik6T57oQUKubF0IuB8wtN8q0A7OIuGixmcFtXiYTuH4EG4/O4tiJVdvTYX+PH+erXYSv0LYuxWb79e/6DfmylD+BJEcWAUzOVmZcg3VlQeM4XvUKMM3rQmP9KkhGSqjpLtYdnNnaHg73CWtflv2wXhrgkx4abjQUsAaVLQDiOEernUKw6N19MktHcrY/jUYzLZ5xgNWQc5wvGHSZmwxx3ek5Fc6n0J7c7wBX076mnV+qRJczgrCoXXS8YFKpMI46zdDtJDBstLZ/PxSmcKQAZa4dsFOYo1uPlTDRaWPs+CLSsr/D5fDE4PkhChoN5Ve87kjXygQC8qQoim6cFd77zJ97QHLvhU5eRBa4qB07BG3w3lBIH4gQmAxRN0anHOx1gD/Sau54EhU/EaFab6UZD0suMi523ote12E8CINeU3Cl4bqWE1NXZ6jywh1lmseK5JqhKhXsjpiAkVJQ1x1pvHtkq33RnYe9wMqsozP04vPpd0S8+IIcCVygvYgHFIzLCAkI5JTqyqffpIq0FHXr/lLvcDWq3Xrs5rGmd2GVYGfJDs6z43d28YipiFYeL6uSZaBLr5WuCThAF5WxvRkhBsTHGeGryZGvzIpyc93pNs/V/99L/+2AfwkwAIpSa6LlmvuQAAAAAElFTkSuQmCC\a
The text I pasted above is the content of file /tmp/three
2> Merge the images use ImageMagick, which you can reference here.
Please let me know if these two solutions can't solve your problem properly.

How can I make command prompt produce miltiple lines of output simultaniously?

I have a batch file that has been aesthetically formatted to display information center console at variable dimensions. In order to achieve this I have used the echo command followed by a period to produce white-space, or just empty space, above and below the content. See the left side of the picture
This works fine for "frames" that switch once per second, but when I remove the the delay it becomes obvious that each 'echo.' is producing one line of white space at a time, creating a rapid scroll, rather than a seamless transition. See the right side of the picture
[]
I've seen a cmd bouncing ball animation on a DIY website, where one of the commenters used a lot of for loops to produce a box with a ball bouncing inside of it. He managed to avoid the scrolling. But that code looked very complicated. I'm not ready to decipher it. But if there were a way to make command prompt produce two ore more lines of white space simultaneously, rather than procedurally, that would be of more use to me. More specifically the ability to produce, as a single instance of output, a whole block of text would be what I am looking to do.
If you want to print on the same line, use echo -ne with \r, which is the return carriage (ie. Print next character at the beginning of the line). Google it for more information.
If you are trying to add intervals between your prints, you can use sleep.
Animation is done through careful use of \r to start writing the same line(s) over again. This can be done with a single or multiple echos.

How to Highlight Text in PDF with commandline (windows)?

I'm looking for a way to highlight words (e.g."some words [0-9]") or better the whole line with the given words in it, in some onesided PDFs.
It will be part of a Batch-process on Windows, so i need a command line way to do this. I've looked at Ghostscript, but can not see how it is to be used.
hope i didnt made something wrong - i looked into other questions, mainly Add comments to PDF files automagically with regular expressions but this helped me not really, also english is not my native language - as you maybe have noticed already.
Thanks in advance
Ghostscript can't do this. Generalized text tools also can't because (1) most PDF's have the text commands in compressed blocks, and (2) text often is not 'encoded' in any standard way. Sometimes the font provides a ToUnicode map, but often not even that and (3) what looks like text may not even be text -- it may just be bitmapped images.
A tool like 'mutool clean -d' and "expand" a PDF so that (1) is solved -- text commands can be found in the PDF, but you still may have things like:
(!"##$) Tj
instead of Hello because of (2). And then there's the other way kerned text is done in PDF, even if standard encoding is used:
[(H) 120 (e) 80 (l) 95 (l) 95 (o)] TJ
It might be possible, but very difficult, and would require programming, and still would not address (3) (that would require OCR of the bitmapped text).

Difference between hard wrap and soft wrap?

I am in the process of writing a text editor. After looking at other text editors I have noticed that a number of them refer to a "soft" versus "hard" wrap. What is the difference? I can't seem to find the answer by searching.
A hard wrap inserts actual line breaks in the text at wrap points, with soft wrapping the actual text is still on the same line but looks like it's divided into several lines.
It's usual for text editors to auto-wrap text into paragraphs with hard newlines, but it's less common for the text to be re-flowed into a nice paragraph if you come back later and edit/add/remove words later on. (You can do this manually in emacs with M-q.)
This is rather annoying, since obsessive compulsive people like me then go back and have to manually re-insert the hard breaks at the appropriate points.
On the other hand, soft wrapping is annoying because most all command line tools use line-based diff-ing (version control is where this becomes most noticeable to me). If you've got a 1/3-page paragraph that's soft wrapped and fix a typo, it's basically impossible to see where the change is in a regular diff output or similar.
soft : The text in the textarea is not wrapped when submitted in a form. This is default
hard : The text in the textarea is wrapped (contains newlines) when submitted in a form. When "hard" is used, the cols attribute must be specified
Reference: W3Schools

Resources