문제

I am writing a shell script that will perform 2 tasks. One task will start up a program that must keep running continuously. Within the same script, the 2nd task is to be initiated that will start up another program. But when the first is running continuously, how can i start another within the same script ?

Thanks in advance.

도움이 되었습니까?

해결책

You're probably looking to background a task. Generally, you do this like so:

sleep 30 &
sleep 30 &
jobs
echo 'Waiting for all jobs to complete.'
wait

The backgrounding is handled by the & symbol at the end of the line.

See Also

다른 팁

Add an ampersand after the command:

~$ myprogram&

It will place the program running in the background.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top