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…
Is there any random generator library except rand(), which developer can manually set the seed?
I want to verify that if the seed is same, the resulting pseudo random number is same. Using rand() is the simplest but I’m looking for safer way. I found that using device entropy with /dev/random of linux is very reliable but cannot find how to set exact same seed. I also tried cryptgenrandom of windo…
Setting up minecraft server service on usb hard drive problem
I’m trying to set up a minecraft server to play with my friends. It’s my first time doing this on linux, so I have a (I believe) small problem. I can’t figure out how to set up it on my usb hard drive. Here’s my minecraft.service small edit – I removed -%i, because it’s to …
Alternative to cron that retains environment variables
I have been trying to set up a cron job to run a bash script every 30 minutes on a Linux-based compute cluster. The problem is that some functions normally available in my shell are not available to the cron job, causing it to crash. I import all my environment variables (including the ~/.bashrc) but no luck,…
Where can I download the Northwind sample database for SQLite?
After looking at: Where can I download Northwind database for Postgresql? it looks like the best place for Northwind data, outside of the Microsoft itself, is: https://code.google.com/archive/p/northwindextended/downloads to what extent does this raw data match the Microsoft data? Is there any advantage in do…
Compiling my C++ exe for Linux with VS2019
I have created a C++ standalone exe with VS2019. This exe uses 1 external ressource file. This exe creates WAV files. It does not use any special libraries. I have been asked if this application runs under Linux, too. What would I have to do / check to see if / how I can compile my application for Linux, and
How to iterate over two arguments in the sh linux shell
I have two sets of arguments: a = “5 7 1” and b = “dogs cats horse” They should come in pairs: 5 matches dogs, 7 matches cats and 1 matches horse They also should do this in one line: The problem is that the $a and $b can have hundreds of arguments, so writing many lines like the above
need perl to die when implicit open fails
I’m trying to migrate a sed script to a perl one-liner, because perl supports non-greedy regexp. I’ve taken advices from Non greedy (reluctant) regex matching in sed? and Why is my Perl in-place script exiting with a zero exit code even though it’s failing? I need my oneliner to exit with no…
Remove part of file name in multiple sub directories
The main folder “Main” contains multiple subfolders (6900,159, 9997, …) and each subfolder contains 8 items (4 files (6900Log.final.out, 6900Log.out, 6900Log.progress.out, 6900SJ.out.tab), 3 folders (6900_STARgenome, 6900_STARpass1, 6900_STARtmp), and one compressed file (6900Aligned.sortedB…