I have a file with contents as: Hi welcome ! Chunk Start Line 1Line2! Chunk Start Line 1 Line 2 Line 3 ! Chunk Start Line 1Line 2Line 3Line 1Line 2Line 3Line 4Line 5Line 1Line 2Line 3Line 4 Now, everything beginning with “! Chunk Start” and before the next “! Chunk Start” is a chunk, i…
Tag: linux
My command line gets colored after I output a colored command in linux terminal
I wanted to have colored ping command output using a shell script. But in the process, I ended up having my command line also colored. Is there any way I can have only my output colored? Here is my bash script: Please see this for example: Answer You need to reset the color after you set it. With tput, this
Get latest release version number for chrome browser
I am trying to figure out a rather stable way to programmatically determine the latest release version number of the chrome browser. It doesn’t have to be failproof as it’s only a nice-to-have-feature I can blend out whenever the result looks “suspicious”. There seems to be no API (is …
Read noonnamed pipe in terminal
Hellow. I have very simple C program. I create pipe in program (standard, non-named). Can I read pipe of existing process in terminal (stream with > or cat?). I try it but my command do nothing. Im know tkat i can create named pipe who is very easy for external I/O. I have number of pipe for /proc/number/f…
Propagating all events from a X window
I’a currently working on a small utility, it’s my first ever X project. The utility is used to draw a small circle around your mouse pointer. I use an app called Pinpoint to do the same on my Mac, it helps me find my mouse as I’m visually impaired. The utility creates an transparent X window…
Looping through the file,searching nan’s
I have file with 12000 lines,some of them are nan’s I have written bash,to search for these nan’s But only this appears on the screen What’s wrong with my bash? Answer you are using exit statement, that means this script will immediately exit after printing FIRST error: Not a number . So wha…
Read binary file,cannot execute binary file: Exec format error
My code When I compile with gcc gcc -c n1.c -o n1 and try to run it I got File m_6 and n1.c were executed on the same machine. How to solve this? Answer gcc -c compiles source files without linking. Cancel -c from from command.
How to Grep for special characters in Linux
I wanna grep this $_SESSION[“sig”] in Linux, and find out all of files with this variable. I used but they are not working How can I fix this? Thank you. Answer Just use the grep -F ‘$_SESSION[“sig”]’ * command.
Check_MK – configuring legacy check
I am running OMD 1.20 -latest according to official website, Check_MK 1.2.4p5 community edition on an Ubuntu 14.04.3 LTS machine. I need to configure a FTP check that will check also the credentials and reading/writing a file. The standard plugins do not offer such a feature from what I know so I am trying to…
What exactly does Valgrind take in to account when giving the number of allocations? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 7 years ago. Improve this ques…