My problem is that the children does not have the same parent and does not appear correctly, here is my code: As of right now when i run the program i will get this as output in bash, where bash has the PID of 11446: How do i get the first child to appear first, second child to appear second
Tag: linux
Remove string in file on linux
I am looking to remove the _id field and its value which changes: I would like to use sed or any other command. Answer It is easy with jq. O/P:
G++ cannot resolve paths when called from subprocess
I am writing a small python script to for automatic student homework evaluation. I have a skeleton, where submitted homework is unzipped into a temporary folder and my script is called with path to the temporary folder as an argument. My script first copies over some extra files I need and then tries to compi…
Why is execvp() executing twice using fork()?
I am implementing a shell. When attempting a command other than changing directories, execvp() runs, the child terminates and a new child is created. When I change directories, the child does not terminate and a new child is created. Here is a sample of my code: cd ../; ls; runs correctly, except I have to Ct…
How to find if remote host is reachable over SSH without actually doing ssh
I have multiple remote hosts connected to my local host (server-A). TO ensure/filter the list of hosts which are genuinely reachable to localhost , I do ping test. However ping test could not provide me any check to ensure that filtered remotehost-IPs are reachable over SSH connection /port 22. Query: Above c…
Building RPM to install .desktop file that contains MimeType
I’m trying to build RPM to install .desktop file that contains MimeType, because .desktop file contains MimeType it needs update-desktop-database command to take effect after placing .desktop file in /usr/share/applications, how to do so? Answer I have achieved this by adding the following part after %i…
How to execute a shell script using CMake post_build?
How to execute a shell script using CMake? The command that should be run is my_script that should be executed after build. The CMakeLists.txt DISCLAIMER Yes, there are similar questions in SO here, here, here, etc; however, they don’t give me a clear vision how this can be achieved. Answer You are invo…
hard-coded bin path and NixOS
When I try to do a manual source install of some software on NixOS 15.09, I get (sh -x is to get an exec log): And indeed there is no bash program in /bin/ However when I inspect the script I dont see any mention of it so it must be some subprogram looking for it. As an aside, I
change “node” command into “nodejs” on windows
I am working on a nodejs project that I got from a linux user and he asked me to change the node command to nodejs , and I am using a windows system. So instead of node index.js I need nodejs index.js I have tried the doskey command but it does not seem to work as I get just an
Linux terminal( Vim ) cannot paste the whole code?
I have a problem for long time, when I use Linux terminal or putty pasting code, usually the code cannot be completely pasted, usually the beginning will lose. For example, I copy a piece of code using “ctrl+c” in a browser. Then I open the file in terminal using vim, right click then choose ̶…