All Questions
Tagged with shell multiprocessing
25
questions
1
vote
1
answer
67
views
Multiprocessing in bash [duplicate]
I wrote a script (wrapper) over one python project.
here are the links:
https://github.com/daniellerch/aletheia
https://daniellerch.me/stego/aletheia/intro-en/#aletheia-commands
The essence of the ...
2
votes
2
answers
1k
views
How to wait in bash script to subprocess, if one of them failed so stop everyone
How to wait in bash script to subprocess and if one of them return exit code 1 so I want to stop all subprocess.
This is what I tried to do.
But there are a some of issues:
If the first process is ...
0
votes
1
answer
50
views
What is the best explicit and implicit way to use a class contains an infinite loop in its methods?
I'm trying to code a class which includes a method that loops infinetly until an explicit interruption request made like below:
# module_2
import sys
from time import sleep
from pathlib import Path
...
0
votes
1
answer
518
views
Subprocess shell command not termination on subprocess.terminate()
I'm using a subprocess to run a command in terminal. I want to terminate the process when an event occurs by using the .terminate() function, however this doesn't seem to work.
pipeline = "gst-...
0
votes
1
answer
82
views
Error with redirecting input from file to C multiprocessed program
I input from files input1.txt and input2.txt to program with help of shell script, I expect to have in file a.txt and b.txt content of those files, but in one file is ok, but in another garbage like ...
2
votes
2
answers
806
views
multiprocessing for bash loop
I have a non-trivial Bash script taking roughly the following form:
# Initialization
<generate_data> | while read line; do
# Run tests and filters on line
if [ "$tests_pass" ]; then
...
-1
votes
2
answers
2k
views
How to do multi-process with shell script? [duplicate]
I want to write a shell script which can start two python scripts parallelly. Other commands in shell script will run after the two parallel python processes are done.
In conclusion, two key-points:
...
2
votes
2
answers
521
views
Is there a way to flush stdout on process termination for parallel processes
I'm running several independent programs on a single machine in parallel.
The processes (say 100) are all relatively short (<5 minutes) and their output is limited to a few hundred lines (~...
1
vote
2
answers
123
views
Unexpected behaviour when calling shell command on a deployed web app
I am deploying a flask app, in which a multiprocessing.Process will be started. Inside this process I call a shell command trough subprocess.call(). The script runs fine when executed on local host, ...
1
vote
1
answer
336
views
Python: Use multiple python windows for a same program
Is there a way to have a python program being able to open and manage multiple terminal windows? Like, in my script, making two windows open, and when I write something in the first one, like with
d =...
3
votes
2
answers
7k
views
wait not working in shell script?
I am running a for loop in which a command is run in background using &. In the end i want all commands to return value..
Here is the code i tried
for((i=0 ;i<3;i++)) {
// curl command ...
1
vote
1
answer
657
views
Use read builtin command to read from parent stdin while in a subshell
I have script that is launching a subshell/background command to read input and then doing more work:
#!/bin/bash
(
while true; do
read -u 0 -r -e -p "test_rl> " line || break
echo "line: ...
0
votes
1
answer
229
views
Why is the output from these parallel processes not messed up?
Everything is executing perfectly.
words.dict file contains one word per line:
$ cat words.dict
cat
car
house
train
sun
today
station
kilometer
house
away
chapter.txt file contains plain text:
$ ...
0
votes
1
answer
66
views
Starting 2 parallel processes in different shell windows
I got two functions: both for starting Server on particular port. Something like:
from Multiprocessing import Process
import sys
def start_server1(port1):
os.system("server1 --port %s" % port1)
...
0
votes
1
answer
2k
views
How can I execute a shell command in a child process in Python?
I need to use the multiprocessing module (rather than subprocess, as I need to use pipes) to execute a shell command as a new child process. At the moment I'm using:
p = subprocess.Popen(...