I want to do parsing of Elapsed time in seconds .Time formats given below: i’m getting values from systemctl status cassandra | awk ‘/(Active: active)/{print $9, $10,$11}’ Now storing it’s value in variable A,like now A has input as 3 day 18h or 3 day etc. More examples- A=3 day 18h or…
Tag: linux
How to cut string between two search patterns(including search patterns) from a file?
I have a file called applications.txt which contains the following data : The strings in this file contain hostnames which I would like to display as follows : Few of the above servers are UAT and few are PROD servers. As you see the host-names are sandwiched between two patterns: First pattern is -x (lowerca…
How to pass additional arguments for docker daemon
I have under /etc/sysconfig/docker , the following configuration :- Now I am using docker version 17.03.1-ce on Red Hat Enterprise Linux Server release 7.4 and default storage driver as overlay that is causing lot of build issues due to :- After doing a bit of research on the internet figured out to get rid o…
Converting from batch to shell
I have a set of batch commands that I’m trying to convert to shell so I can use them on my linux environment. The command should read In windows (using batch), running this command should produce a set of files that are numbered like this: 0001_inside.hdr 0002_inside.hdr etc. However, when I ran this co…
What does `exit()` send `status` to, the parent process or the OS kernel?
In Linux, What does exit() send status to, the parent process or the OS kernel? APUE says that exit() performs certain cleanup processing and then returns to the kernel. But when I run a program in shell, the program returns its exit status to the shell which is its parent process. Answer As you’re prob…
How can I expose a port from ASP.NET Core in Docker linux container in Windows?
I have several ASP.NET Core services defined in docker-compose. I need to be able to expose port in the host network (I use linux containers on Docker for Windows 18.03.0-ce). Sample: Services C1 and C2 are running in containers. Service H3 is running directly in the host, not in container. All services (C1, …
./configure + endless loop
Am trying to build/install LFTP in Centos 7 and can’t get past an endless loop at ./configure stage. Steps I’ve taken: Then I see an endless loop of: Any suggestions/tips appreciated. I’ve tried to use a prefix with ./configure too but that doesn’t help. Answer As discussed in the comm…
In a system call are hardware and software context saved?
Who saves the hardware and software context before the system call routine? Is it the processor itself or the software handler? Thanks. Answer Each system call has a wrapper function as already mentioned, each wrapper function triggers interrupt 128, int 0x80, which automatically saves on kernel stack the reg…
How to ensure a signal handler never yields to a thread within the same process group?
This is a bit of a meta question since I think I have a solution that works for me, but it has its own downsides and upsides. I need to do a fairly common thing, catch SIGSEGV on a thread (no dedicated crash handling thread), dump some debug information and exit. The catch here is the fact that upon crash,
How to find what folder process can’t open
I have an application that is not functioning, because it can’t find or open the folder. But it does not print the folder path. How i can find out what folders it tries to open or locate? Probably folder does not exist, or has wrong permission. But to fix this i need to know what folder application is o…