Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does wait $! mean

Tags:

bash

context of the command is

su postgres sh -c "$POSTGRES -D $DATADIR -c config_file=$CONF" &
wait $!

not recorded in the manual

man wait

NAME
   wait, waitpid, waitid - wait for process to change state
......

documentation

and http://www.gnu.org/software/bash/manual/bashref.html#index-wait which is refered from wikipedia

like image 901
Hello lad Avatar asked Dec 18 '22 22:12

Hello lad


1 Answers

From man bash:

($!) Expands to the process ID of the job most recently placed into the background, whether executed as an asynchronous command or using the bg builtin

like image 119
whoan Avatar answered Jan 03 '23 01:01

whoan