Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [wait]

The tag has no usage guidance.

3
votes
2answers
92 views

Regain ability to use ^C to close backgrounded then (effectively) foregrounded processes

In the interactive console, pressing ^C on zenity --info & fg closes the Zenity window. One can only use zenity --info & wait in a script. But ^C doesn't close the Zenity window in this case. ...
0
votes
1answer
63 views

how signals are handled in linux kernel [closed]

My question is about signals and handling them inside the operating system kernel. I know that every process has it own signal_handler() table: a 31 bit array for signals (pending_signals), and when a ...
0
votes
0answers
79 views

How to wait for the execution of a python script inside shell script?

I want to mount another root partition, edit the grub.cfg file with a python script and afterwards umount the partition again. How can I wait for the python script to finish and check if the partition ...
2
votes
1answer
106 views

What does the `-f' option do for `wait' versus the default behaviour?

Bash 5.0 includes a new -f option for wait:[1] j. The `wait' builtin now has a `-f' option, which signfies to wait until the specified job or process terminates, instead of waiting until it ...
0
votes
2answers
220 views

Why should parent process wait (to terminate) until all of its child process terminates?

I know there is no enforcement for the parent process to wait until all its child process terminates. However it's a convention followed. Furthermore, I know that if parent process terminates before ...
0
votes
1answer
96 views

tmux send-keys confirm ssh tunnel is closed (after sending multiple commands to the remote host) before proceeding

there is an answer here about tmux using wait-for and LocalCommand to wait until the SSH connection is established before continuing, but I needed a way to have tmux wait for the ssh session to be ...
3
votes
3answers
596 views

sleep, wait and Ctrl+C propagation

If I have the following shell script sleep 30s And I hit Ctrl+C when the shell script is running, the sleep dies with it. If I have the following shell script sleep 30s & wait And I hit Ctrl+...
0
votes
1answer
78 views

How can I make `enscript` block till the printer finishes its job?

The following command will create a pdf file under ~/PDF/: enscript -B -P PDF bloom.c I want to move the output pdf file here ...
-1
votes
2answers
109 views

Wait command works when pid doesn't exists

I'm facing an unexpected behaviour of the wait builtin. ~ ❯ sleep 1 & [1] 72009 ~ ❯ [1] + 72009 done sleep 1 ~ ❯ wait 72009 ~ ❯ echo $? 0 Although the PID doesn't exist anymore wait ...
0
votes
2answers
188 views

Use waitpid for child having groupid 1

I searched a lot but didn't find a solution. So it can be silly question. The format of waitpid is pid_t waitpid (pid_t pid, int *status, int options) The pid parameter specifies exactly which ...
2
votes
1answer
2k views

How do I wait for nohup jobs to finish within a shell script?

I have the following script: echo "$wk" | while read -r a b; do counter=$(($counter+1)) nohup sh -c 'impala-shell -d nielsen -f query.sql --var=dt=$a --var=incre=$b; echo $a,$?>>$...
2
votes
3answers
747 views

Bash script to wait for a process to finish on multiple servers [duplicate]

I wanted to ssh to multiple servers remotely and check whether any processes running on those servers and wait until the process to get finished. I have written the below code but this checks only for ...
2
votes
1answer
236 views

Run subshells in parallel and collect exit codes

I have the following, I thought it ran the subshells in parallel, but it actually seems to run them in series, and I cannot figure out why: #!/usr/bin/env bash set -e; set -m # allow for job control ...
7
votes
2answers
23k views

Run commands in parallel and wait for one group of commands to finish before starting the next

I have script including multiple commands. How can I group commands to run together ( I want to make several groups of commands. Within each group, the commands should run in parallel (at the same ...