wait (명령어)

위키백과, 우리 모두의 백과사전.

wait
개발자AT&T Bell Laboratories
발표일1973년 11월(50년 전)(1973-11)
운영 체제UnixUnix-like
종류명령어

wait유닉스 에서 백그라운드 프로세스 실행이 끝날 때까지 일시 중지하는 명령어이다.

사용법[편집]

 wait [n]

여기서 n은 현재 실행 중인 백그라운드 프로세스(job)의 pid 또는 잡 ID이다. n이 지정되지 않으면 이 명령어는 알려진 모든 작업에 종료가 호출될 때까지 기다린다.

예시[편집]

#!/usr/bin/env bash

# Parallel update script which makes use of the wait command

# Update local copy
rsync iona:src/ . &
# Upgrade required libraries, or exit indicating failure if make failed for some reason
make -C lib || exit 1

# Wait for rsync to terminate (may have already happened) and finish the job
wait
make

외부 링크[편집]