Here is my code. But teacher said it’s incorrect and something is wrong in if (pid == 0) condition body. Help me out please. Thank you! Answer fork() returns 0 for child process, >0 for parent process, and a negative value if there were errors. Your child process finishes immediately, so actually you…
Tag: linux
The optimal way to lock and write to a file in Scala on Linux
I’m having a hard time finding the correct way to do any advanced file-system operations on Linux using Scala. The one which I really can’t figure out if best described by the following pseudo-code: Basically open a file in append mode (create it if it’s non existent), get an exclusive lock …
Moving files with a specific modification date; “find | xargs ls | grep | -exec” fails w/ “-exec: command not found”
Iam using centos 7 If I want to find files that have specific name and specific date then moving these files to another folder iam issuing the command with the following error Answer the -exec as you wrote it is quite meaningless, moreover it seems you are mixing find syntax with shell oe (-exec as you wrote …
find files with specific name and specific date command returns wrong result [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack …
Error initialization from incompatible pointer of IOCTL function in Linux kernel 4.8.0-53-generic Linux Mint 64 bit
I’ve got an error while writing a char device module, using Ioctl command. Note: please ignore all my print_k. Please, help me fix this. My thanks to all of you. Here is my code : Answer The third argument unsigned long arg[b] in the function prototype is dubious. It should be simply unsigned long arg e…
Can not install Oracle database in Linux 7
I am trying to install Oracle database to Linux machine.I am getting error down below Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<< I run commands down below but it still returns error. What should I do? Linux Ver…
Split string in xml
I have xml file which contains data . I want to split only FATURANO Like that 6-R-7 and 4825 And this “4825” should have different name. I Need convert xml data like that but if u answer me only with first question how to split string correctly i will do other transpormation Answer With single xml…
Using grep to match where two tokens occur on the same line
I am reading the man page, and found this blog post, and both seem to say the same thing, but it does not work. I have a project where I need to batch replace lines like into but I do not want to match lines like : i.e. : only “imports” from the base dir /modules. I have tried but
Not able to execute a .csh script using jsch library – Exit 1
Im trying to use Jsch to execute a .csh script on a remote server. I am able to execute commands like cp, mv and ls. But when I try to execute a script that internally references some environment variables, the script is exiting with status 1. There is an INTERNAL_ENV_VARIABLE referenced inside script.sh that…
dh: unable to load addon autoreconf in Ubuntu 14.04
I am working with Openvswitch to create mpls vpn network on mininet platform. I am using Ubuntu 14.04 server with kernel version: 4.4.0-97-generic. I am trying to upgrade my openvswitch from 2.0.0 version to version 2.5.2 which is supported by kernel version 4.4.0 . I am following the steps for openvswitch up…