I wanted to have a script that is capable of killing console windows, that are either running something or not, but at the same time, keep alive the window that executed this script. Thanks for your help Answer You can find the command name of the parent the script (bash, sh, zsh, etc.) then kill all the proc…
Tag: linux
Bash script that will read a number from file and run command if number equals or is higher than X value
I would like to have a script that reads a number from a file, and if this number equals or higher a certain value, it will run another command, if not, script will just die, it would be something like this: Thanks for any help. Answer
advanced printf explanation in bash
I just found this programming segment in my son’s Bash file. I am quite a newbie and unable to understand the printf syntax. Can someone explain me the COMMENTED printf in the segment below?? Answer It’s is nothing but a busy/wait spinner and the lines commented do nothing but set a blue foregroun…
How can I execute a command inside another folder and return to original directory?
I use this command to make inside a folder: But I want to return to original directory after the command I tried this: But this doesn’t work. How can I do it? Would help in quick testing… Answer Use a subshell, like so: The shell forks before running the commands in brackets, so once it completes …
write error disk full in EC2 Machine [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 in malloc while trying to create a thread
Hi everyone i post only the core of the code which create probleam and which work with threads. As we can see foo function create new thread and reallocate memory to store the pthread_t. Then it try to create a new thread with pthread_create as NULL as attr and arg and as function pointer a pointer to foo2; N…
Kivy VM Buildozer Command Failed
I recently learned about kivy and tried to make a very simple little app just to test it. To try it out properly I used the kivy launcher but also felt compelled to try and compile it to an APK for my android phone. So I downloaded virtual box and installed linux mint on it. After installing things like java,
Why am I getting an error message when trying to “cat” my char device driver?
I’ve written a simple character device driver for Linux. It is a simple message storing/retrieving system where the messages are stored in kernel space. I should be able to do something like this: and then retrieve the message with The messages are stored in a queue. When I try to retrieve a message tha…
Sorting an array of dates in bash
I want to sort an array of dates. Example format: “2017-11-13_07-55-40” or Year-Month-Date_Hour-Minute-Second Answer Since your dates are already in YYYY-MM-DD-HH-MM-SS format, you can use numeric sort: To store output in another array use:
pip freeze doesn’t show opencv in Linux/Mint
I’ve installed OpenCV on Linux Mint and I can import it in python But when I want to see it in pip freeze, it doesn’t appear: Also, I tried to import it via PyCharm’s Project Interpreter. It wants to installation with pip. (pip install opencv-python and pip install cv2) When I installed that…