Skip to content

Differing CPUID usage from high-level languages

I’m attempting to utilize an x86 ASM function that requires certain processor architecture. I understand that I need to check a specific bit after calling “CPUID standard function 01H”. Below is a C implementation from the CPUID Wikipedia page for calling CPUID: Though the Linux kernel uses …

Bash Jq parse json string

I’ve to call a file and pass a json as parameters in this way (suppose that my file is called test.sh), from bash I need to do something like this: and the content of test.sh is the following the output of -> printf “$system_user” is but the output of -> printf “$accounts” …

Bash list datetime between two dates

How to list all datetimes in the format “+%Y-%m-%d %H:%M:%S” ? This only prints the dates, but I want the time included as well i.e. 2016-07-20 08:33:21 Answer Hope this one can help you: Output:

Bash: transform key-value lines to CSV format [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago. Improve this question Editor’s note: I’ve clarified the problem definition, because I think the proble…

Why does msgrcv returns ENOMSG

System V message queue is created successfully, command ipcs -q outputs: But the program to receive the message returns: exit: msgrcv error, No message of desired type This is my code: Answer Transferring comments to an answer. I suggested: Maybe there isn’t a message waiting? Where did you write the co…

How Do I Fix This SED Command to Find & Replace a String

Good-day, I’m working on a Bash script for Debian Jessie and in this line; I am trying to find base_dir}/scripts and replace it with script_dir} so that my new line will read as: This is what I have tried so far; which results in this error; I am confused as to how to resolve this and would appreciate s…

Use of -g and -o options in gcc command in c programming

Suppose there are 2 c program named abc.c and xyz.c . Now we want to work with the 2 executables at a time. So we change the name of the ./a.out using Even gcc -o abc abc.c works. What does the -g and -o in the above commands specify or describe? What is the significance of -g and -o in