String: I want to grab everything before the first instance of | and everything between External_SOC and ;PCRF. And store them as 2 different variables if possible. This gives me the following: 40125512ALPHA3 Answer EDIT: As per OP it needs to be done in a single line creation 2 of variables if this is the ca…
Tag: linux
Replace every second instance of word in each line of the file
I’m trying to replace every second instance word of each line with sed. For example: If I had a line as below should be replaced as below. Only second instance of word is replaced with kiran/. My attempt : Output: My Question: Please help me with the proper sed or any Linux command which does the above …
How to deploy .net core in Kubernetes?
Recently I started study Kubernetes. And I want to deploy .net core in Kubernetes. How to deploy .net core in Kubernetes ? Maybe there is a simple example ? Answer There are lots of resources on the web for the specific mechanics that I will add at the bottom. This is a very broad question and probably not a …
Open pdf file created in a docker container(Alpine)
I am trying to open pdf file that I created inside a Docker container. I tried using xdg-open and Firefox but I’m getting the following errors: I don’t know what to do. Please help. Answer Copy the pdf out of the alpine container with docker cp alpine:/path/to/pdf . and open it on the host.
bash script to auto run on boot, make screen, execute a command and detach
I am using Centos 7 and on boot I would like to: Make a screen Execute a command: osrm-routed –algorithm=MLD ~/osrm-backend/profiles/australia-latest.osrm Detatch from screen (possibly not needed, just as long as I can access it myself after its running in future) Here is something I have thought about,…
How to list filenames containing a specific string
I’ve been searching for commands that would print the list of filenames that contain a specific string, regardless if the string is part of a bigger string. So for instance, say there’s a directory with files “DABC.txt”, “ABC.txt”, “ABC”, and “CDA.txt̶…
Getting only hexa decimal byte values from the disassembly of a compiled library
I have used objdump to disassemble all the functions in a compiled library file and written the output to a text file. In the text file the output of function called clear_bit is as follows. The output of an another function set_bit is as follows-: Similar to the above two functions, this output.txt contains …
Will process load into memory with 4 or 8 alignment rule
I just learnt about 4 or 8 memory alignment and came about this question. Will Memory alignment happen in virtual memory space or absolute addresss? I guess the answer is virtual memory space, and the os will load the process to the position that the absolute address ends with ‘0X00’ or ‘0X0…
Parent/Child and pipes in C, child-parent comunication
I have a parent program that sends a integer to a child, and the child program multiplies the number by two and gives back to the parent. In a main program I create a pipe and fork() and execl() the child, after a switch I pass the value through pip to child in child i can get the value, but
Linux bash ‘[: -ge: unary operator expected’ error
I tried this code and it gives many errors that could anyone help me to fix this problem please. Answer The source of the problem reported in the question is an empty decvalue as syme has already stated. Considering the purpose of the script, it seems you attempted to write a recursive function. For this reas…