Files
docker.softwareshinobi.com/docs/Linux-Commands/.recycle/121-the-wait-command.md
Software Shinobi f1997cab0f
All checks were successful
code.softwareshinobi.com-learn/docker.softwareshinobi.com/pipeline/head This commit looks good
automated terminal push
2025-06-04 11:50:30 -04:00

28 lines
528 B
Markdown
Executable File

# The `Wait` commands
It is a command that waits for completing any running process of given id. if the process id is not given then it waits for all current child processes to complete.
## Example
This example shows how the `wait` command works : <br />
**Step-1**:
Create a file named "wait_example.sh" and add the following script to it.
```
#!/bin/bash
echo "Wait command" &
process_id=$!
wait $process_id
echo "Exited with status $?"
```
**Step-2**:
Run the file with bash command.
```
$ bash wait_example.sh
```