I am trying to parse an ini file inside a shell script. name.conf file: I could parse the values by the command I wanted to know if there was some way by which I could group the contents of my config and parse it name.conf file: I just need the values in a shell array say names and print them
Installing VTK: matching usr/lib/libGL.so path to the one in build system config
I’ve been trying to install VTK on my Ubuntu 14.04. I had some trouble getting things to configure since it couldn’t find OpenGL, but I (thought I) fixed that by using and as was suggested in this question. However, now I can’t run make because the path to libGL.so isn’t correct. IR…
Can i force linux kernel to use particular memory pages for new executable
When i execute binary i want their stack segment to be filled with special data. All i do is just write program that allocate huge buffer on a stack, call a lot of malloc and mmap and for example fill all this memory with ‘A’ character. Then i check and see that about 80% of whole memory are used …
If a File is Empty, Write Text to First Line
I need to check to see if two files are empty. If they are, then write “-999” to the file, else run an average on the numbers within the file. Here is the coding I’ve been trying to use: Code: Contents of file_all: Answer the appropriate way to check whether a file is empty is using -s not -…
Why can’t this user delete this file?
If I do: I see: If I sudo to root and then su to jenkins, I should be able to delete this, yes? Other relevant information about the directory and its parent: If I do: then I see than the user “jenkins” has been added to the “root” group: But if I: I get: Why is permission denied? Answ…
How to compute Cumulative values in Shell?
I would like to compute cumulative values from the below data file and writing them into columns after inserting a serial number. Where ifile.txt has 3 rows and 9 columns in this example. Desire output: Here first column is used for the serial number. So what I did is: I first converted into columns using The…
How OpenVZ boot OS?
I bought VPS on OpenVZ virtualization and enabled Debian guest OS. Guest /boot dir is empty. /etc/inittab is empty. How is the OS initialization process performed? What is the meaning of reboot for OpenVZ container? Answer After research I clone vzctl tool as main job about starting/stopping done here: vzctl …
When a large block of memory is requested on the heap, if contiguous space is not available on the RAM, is it allocated on the disk(swap)?
In Linux, when memory is requested (using calloc / malloc), if a contiguous block of the requested size is not available does the kernel map multiple separate pieces of memory into one single virtual block and hand it over to the application or is it allocated on disk? If it is allocated on disk, when a large…
Extract substring from string in linux
i need to extract oracle-xe-11.2.0-1.0.x86_64.rpm from oracle-xe-11.2.0-1.0.x86_64.rpm.zip and i have no clue how to start. The condition that must be met is only .zip needs to be removed. If there is no .zip then nothing should happen to the string . How to go with it ? Answer Use basename instead: Result:
In a setuid root program, how to check that the current user (that root is doing the work for) owns a file?
The use case is a mount tool, I want to restrict mounting (a unionfs(r+x dir, squashfs) ) to files owned by the caller. I know about fusefs, But I’d like to use overlayfs and squashfs in the kernel. Answer So long as you haven’t called setuid() or setreuid() yet, you can use getuid() to get the us…