Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash monitoring background jobs

#!/bin/bash

# when running "some commands" in the background in your script with '&' 
# and want to wait until they are finished, 
# you can check the number of background jobs in a loop with the jobs command

while [[ $(jobs -r | wc -l) -gt 0 ]]; do
sleep 1
done
Comment

PREVIOUS NEXT
Code Example
Shell :: linux traverse all subdirectories and do action 
Shell :: installing Shoes 
Shell :: Run multiple commands over SSH as sudo 
Shell :: ubuntu list compillers 
Shell :: kylekatarnls/update-helper does not exist and could not be created 
Shell :: ubuntu extract img.xz 
Shell :: close app with terminal 
Shell :: docfetcher ubuntu 
Shell :: prepare ansible playbook to setting up production grade server in kubernetes 
Shell :: linux lastpass export data 
Shell :: how to install nipe 
Shell :: RequestsDependencyWarning chardet 
Shell :: ubuntu 20 terminal rename tab 
Shell :: how iggnor .env change in github branch 
Shell :: run .c file linux 
Shell :: service version nmap sqitch 
Shell :: how to compile semaphore.h in terminal 
Shell :: tablet mode powershell script 
Shell :: run command from history ubuntu 
Shell :: find drive D windows sub system linuc 
Shell :: how to check folxder ezist using bash 
Shell :: how to install voyager on existing project with dummy data 
Shell :: octal notation in linu 
Shell :: How to reload a service with systemctl command 
Shell :: delete file kali linux 
Shell :: how to install amethyst on mac 
Shell :: Fix for infinite log Linux bug 
Shell :: apt upgrade vs full-upgrade 
Shell :: create a new repo 
Shell :: ubuntu pip cv_bridge 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =