Linux??????y???????????
???????????? ???????[ 2013/6/26 9:56:50 ] ????????
??????Linux?У??????y??????????У????????£?????????????????&????????????????????????????????????????
$ ./test.sh &
[1] 17208
$ jobs -l
[1]+ 17208 Running ./test.sh &
?????????????????е?????????????·???????У??????ctrl+z?????????е???????????bg????????????????????У?
$ ./test.sh
[1]+ Stopped ./test.sh
$ bg %1
[1]+ ./test.sh &
$ jobs -l
[1]+ 22794 Running ./test.sh &
????????????????????е??????丸????????????shell???????????????????????????hangup??????????????????????hangup????????????????????????shell???????????н????????????nohup????hangup????????setsid?????????????init???????????1??
$ echo $$
21734
$ nohup ./test.sh &
[1] 29016
$ ps -ef | grep test
515 29710 21734 0 11:47 pts/12 00:00:00 /bin/sh ./test.sh
515 29713 21734 0 11:47 pts/12 00:00:00 grep test
$ setsid ./test.sh &
[1] 409
$ ps -ef | grep test
515 410 1 0 11:49 ? 00:00:00 /bin/sh ./test.sh
515 413 21734 0 11:49 pts/12 00:00:00 grep test
?????????????????????nohup/setsid????&????????????У?????????shell?????????????????????????е??????????????????????disown????
$ ./test.sh &
[1] 2539
$ jobs -l
[1]+ 2539 Running ./test.sh &
$ disown -h %1
$ ps -ef | grep test
515 410 1 0 11:49 ? 00:00:00 /bin/sh ./test.sh
515 2542 21734 0 11:52 pts/12 00:00:00 grep test
????????????????????????????????subshell????У???????setsid??????????????????????????????() ???????????
$ (./test.sh &)
$ ps -ef | grep test
515 410 1 0 11:49 ? 00:00:00 /bin/sh ./test.sh
515 12483 21734 0 11:59 pts/12 00:00:00 grep test
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11