- 论坛徽章:
- 0
|
原帖由 tzccb 于 2007-5-15 09:23 发表
提醒一下,如果用sh kk命令,ps -ef | grep kk,可以看到kk,但如果给kk赋予了可执行权限,直接用:kk&,ps -ef |grep kk,是看不到的,请大家试试
OK. I tested: Only if you don't have "#!/bin/ksh" as the first line in kk.
$ cat kk
sleep 1000
$ ./kk &
[3] 3285014
$ ps -ef | grep 3285014
471200 3285014 0 09:58:49 pts/60 0:00 sleep 1000
1921224 2060344 0 09:58:57 pts/60 0:00 grep 3285014
3285014 2060344 0 09:58:49 pts/60 0:00 -ksh <--
$ vi kk
$ cat kk
#!/bin/ksh
sleep 1000
$ ./kk &
[4] 872576
$ ps -ef | grep 872576
266342 2060344 0 10:00:03 pts/60 0:00 grep 872576
872576 2060344 0 09:59:35 pts/60 0:00 /bin/ksh ./kk <--
1921226 872576 0 09:59:35 pts/60 0:00 sleep 1000
So, adding the "#!/bin/ksh" line (you should, anyway) might be a solution for you. |
|