I am on debian 9. I have a problem to check the password of a linux user in my scripts. I realized that the different linux tools for creating and modifying a user password gave results of different pattern in /etc/shadow To create a user I have in /etc/shadow In another script I want check the password input…
how to print lines with specific column matching members of array in bash
How to print lines when the first column matching members of array(“12” or “34” or “56”)? Add Also, how to print lines when the first column exactly matching members of array(“12” or “34” or “56”)? Answer You could use bash to interpolate…
Count maximum amout of parent processes in Linux
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…
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