監控程序結束 - Linux

By Dinah
at 2013-10-19T18:17
at 2013-10-19T18:17
Table of Contents
不知道用什麼關鍵字,找了一陣子了,
才上來問...如果這問題太蠢了請鞭小力點 Orz
我想要監控程序結束執行與否,來決定要不要繼續執行下一批資料
舉個例子:
$ matlab (程序) &
我用 for + if 控制開超過十個就暫停 (sleep)
但程式執行的時間很難抓,如果暫停的時間太短會大當機。
而程序每次都是自動開的,不會先知道 PID
我也沒辦法靠查詢 ps 去看有沒有結束(是嗎)?
請各位指教我該怎麼監督他是否執行完畢?
--
才上來問...如果這問題太蠢了請鞭小力點 Orz
我想要監控程序結束執行與否,來決定要不要繼續執行下一批資料
舉個例子:
$ matlab (程序) &
我用 for + if 控制開超過十個就暫停 (sleep)
但程式執行的時間很難抓,如果暫停的時間太短會大當機。
而程序每次都是自動開的,不會先知道 PID
我也沒辦法靠查詢 ps 去看有沒有結束(是嗎)?
請各位指教我該怎麼監督他是否執行完畢?
--
Tags:
Linux
All Comments

By Lily
at 2013-10-20T21:42
at 2013-10-20T21:42

By Belly
at 2013-10-22T01:14
at 2013-10-22T01:14

By Isla
at 2013-10-26T16:25
at 2013-10-26T16:25

By Mary
at 2013-10-28T17:58
at 2013-10-28T17:58

By Ina
at 2013-10-30T01:55
at 2013-10-30T01:55

By Linda
at 2013-10-30T06:39
at 2013-10-30T06:39

By Elma
at 2013-11-01T03:37
at 2013-11-01T03:37

By Kumar
at 2013-11-02T00:37
at 2013-11-02T00:37

By Tristan Cohan
at 2013-11-05T12:11
at 2013-11-05T12:11

By Dora
at 2013-11-09T22:44
at 2013-11-09T22:44

By Brianna
at 2013-11-14T10:35
at 2013-11-14T10:35

By George
at 2013-11-19T02:41
at 2013-11-19T02:41

By Kumar
at 2013-11-23T17:17
at 2013-11-23T17:17

By Joe
at 2013-11-23T21:24
at 2013-11-23T21:24

By Delia
at 2013-11-27T19:17
at 2013-11-27T19:17

By Daph Bay
at 2013-11-28T16:39
at 2013-11-28T16:39

By Anonymous
at 2013-12-02T05:13
at 2013-12-02T05:13

By Franklin
at 2013-12-06T05:46
at 2013-12-06T05:46

By Necoo
at 2013-12-10T00:23
at 2013-12-10T00:23

By Andrew
at 2013-12-13T08:30
at 2013-12-13T08:30

By Hardy
at 2013-12-17T21:31
at 2013-12-17T21:31

By Bennie
at 2013-12-21T08:35
at 2013-12-21T08:35

By Delia
at 2013-12-24T14:11
at 2013-12-24T14:11

By Thomas
at 2013-12-24T17:04
at 2013-12-24T17:04

By Leila
at 2013-12-25T09:13
at 2013-12-25T09:13

By John
at 2013-12-27T02:12
at 2013-12-27T02:12

By Jack
at 2013-12-29T07:07
at 2013-12-29T07:07

By Christine
at 2014-01-03T02:01
at 2014-01-03T02:01

By Olga
at 2014-01-07T00:32
at 2014-01-07T00:32

By Catherine
at 2014-01-07T02:21
at 2014-01-07T02:21

By Jake
at 2014-01-08T04:17
at 2014-01-08T04:17

By Genevieve
at 2014-01-12T06:55
at 2014-01-12T06:55

By Wallis
at 2014-01-12T09:05
at 2014-01-12T09:05

By Jack
at 2014-01-13T13:35
at 2014-01-13T13:35

By Wallis
at 2014-01-15T12:34
at 2014-01-15T12:34

By Emma
at 2014-01-17T04:18
at 2014-01-17T04:18

By Gary
at 2014-01-21T18:08
at 2014-01-21T18:08

By Franklin
at 2014-01-22T15:27
at 2014-01-22T15:27

By Candice
at 2014-01-27T05:17
at 2014-01-27T05:17

By Xanthe
at 2014-02-01T02:46
at 2014-02-01T02:46

By Yedda
at 2014-02-05T13:17
at 2014-02-05T13:17

By Rachel
at 2014-02-06T00:44
at 2014-02-06T00:44

By Doris
at 2014-02-06T15:50
at 2014-02-06T15:50

By Ula
at 2014-02-07T03:05
at 2014-02-07T03:05

By Todd Johnson
at 2014-02-07T13:03
at 2014-02-07T13:03

By Elvira
at 2014-02-12T05:41
at 2014-02-12T05:41

By Rachel
at 2014-02-13T08:22
at 2014-02-13T08:22

By Oscar
at 2014-02-17T05:01
at 2014-02-17T05:01

By Kumar
at 2014-02-20T16:00
at 2014-02-20T16:00

By Anonymous
at 2014-02-21T10:36
at 2014-02-21T10:36

By Regina
at 2014-02-25T22:01
at 2014-02-25T22:01

By Victoria
at 2014-02-28T16:03
at 2014-02-28T16:03

By Xanthe
at 2014-03-05T14:08
at 2014-03-05T14:08

By Selena
at 2014-03-06T19:35
at 2014-03-06T19:35

By Regina
at 2014-03-07T14:58
at 2014-03-07T14:58

By Elizabeth
at 2014-03-12T03:02
at 2014-03-12T03:02

By Tracy
at 2014-03-15T12:42
at 2014-03-15T12:42

By Hedwig
at 2014-03-16T01:00
at 2014-03-16T01:00

By Hedy
at 2014-03-16T11:50
at 2014-03-16T11:50

By Erin
at 2014-03-19T11:00
at 2014-03-19T11:00

By Rae
at 2014-03-20T20:19
at 2014-03-20T20:19

By Linda
at 2014-03-23T08:10
at 2014-03-23T08:10

By Edward Lewis
at 2014-03-26T10:33
at 2014-03-26T10:33

By Rosalind
at 2014-03-29T15:59
at 2014-03-29T15:59

By Todd Johnson
at 2014-04-03T05:24
at 2014-04-03T05:24

By Elizabeth
at 2014-04-07T23:42
at 2014-04-07T23:42

By Christine
at 2014-04-09T14:26
at 2014-04-09T14:26

By Brianna
at 2014-04-12T19:20
at 2014-04-12T19:20

By Candice
at 2014-04-14T09:09
at 2014-04-14T09:09

By Thomas
at 2014-04-17T13:30
at 2014-04-17T13:30

By Vanessa
at 2014-04-21T06:07
at 2014-04-21T06:07

By Jessica
at 2014-04-26T01:07
at 2014-04-26T01:07

By Charlie
at 2014-04-29T07:59
at 2014-04-29T07:59

By Freda
at 2014-05-01T22:20
at 2014-05-01T22:20

By Harry
at 2014-05-04T08:04
at 2014-05-04T08:04

By Zenobia
at 2014-05-04T23:18
at 2014-05-04T23:18

By Wallis
at 2014-05-06T18:57
at 2014-05-06T18:57

By Mia
at 2014-05-08T07:42
at 2014-05-08T07:42

By Margaret
at 2014-05-09T18:09
at 2014-05-09T18:09

By Ivy
at 2014-05-11T03:57
at 2014-05-11T03:57

By Skylar Davis
at 2014-05-15T16:05
at 2014-05-15T16:05

By Sierra Rose
at 2014-05-18T07:12
at 2014-05-18T07:12

By Jake
at 2014-05-18T13:31
at 2014-05-18T13:31

By Kelly
at 2014-05-18T19:47
at 2014-05-18T19:47

By Catherine
at 2014-05-23T15:11
at 2014-05-23T15:11

By Dora
at 2014-05-24T06:10
at 2014-05-24T06:10

By Ula
at 2014-05-24T20:47
at 2014-05-24T20:47

By Doris
at 2014-05-28T06:08
at 2014-05-28T06:08

By Rachel
at 2014-06-01T04:21
at 2014-06-01T04:21

By Callum
at 2014-06-02T01:07
at 2014-06-02T01:07

By George
at 2014-06-04T00:15
at 2014-06-04T00:15

By Yuri
at 2014-06-06T09:27
at 2014-06-06T09:27

By Heather
at 2014-06-10T11:22
at 2014-06-10T11:22

By Necoo
at 2014-06-13T01:45
at 2014-06-13T01:45

By Jacky
at 2014-06-15T10:46
at 2014-06-15T10:46

By Robert
at 2014-06-17T07:40
at 2014-06-17T07:40
Related Posts
smplayer有畫面沒聲音

By Frederic
at 2013-10-18T16:24
at 2013-10-18T16:24
Ubuntu 13.10 釋出囉!

By Una
at 2013-10-18T14:31
at 2013-10-18T14:31
lubuntu 13 使用 xrdp

By Skylar DavisLinda
at 2013-10-18T12:42
at 2013-10-18T12:42
smplayer有畫面沒聲音

By Oliver
at 2013-10-18T03:49
at 2013-10-18T03:49
RHEL 6 如何把Gnome換DWM

By Robert
at 2013-10-17T15:06
at 2013-10-17T15:06