Skip to content

Converting euid and egid to username and group name

I looked at some of my system logs and its claiming about errors that apply to random effective user id’s and group id’s. For example: I’m just wondering if theres a simple command I can use in the shell to identify the real username and group ID based on the numbers (which in this example i…

Grep lines from a file in batches according to a format

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…

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…

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.