Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

problem using $$



hi,

this little script shows a (for me) strange behavior.
,----
| #!/bin/zsh
| #  test.zsh
|
| mp=$$
|
| echo "pid=$mp"
| ps aux | grep " $mp "
| echo "----"
| ps aux | grep "start.osd" | grep -v "grep" | grep -v " $mp "
`----

calling the script often in series, i sometimes got this:
,----
|  [fire@crow] (8028) 2005-05-13 18:33:43
|  [~/bin] -> ./test.zsh
|a pid=4128
|b fire      4128  0.0  0.1  2708 1324 pts/4    R+   18:33   0:00 /bin/zsh ./test.zsh
|  ----
|c fire      4172  0.0  0.1  2708 1332 pts/4    R+   18:33   0:00 /bin/zsh ./test.zsh
|  [fire@crow] (8028) 2005-05-13 18:33:44
|  [~/bin] -> ./test.zsh
|1 pid=4173
|  fire      4173  0.0  0.1  2708 1324 pts/4    S+   18:33   0:00 /bin/zsh ./test.zsh
|  fire      4213  0.0  0.0  1628  504 pts/4    S+   18:33   0:00 grep test.zsh
|  ----
|2 fire      4216  0.0  0.0     0    0 pts/4    R+   18:33   0:00 [test.zsh]
|  [fire@crow] (8028) 2005-05-13 18:33:44
|  [~/bin] ->
`----

- first call:
   why is the process id from the second ps [c] other than the process
   id from the first ps [b] and $$ [a] ?

- second call:
   and what is "[test.zsh]" [2] and why has it got another pid (4216)
   than $$ (4173) [1] ?

am i doing something wrong or is this a bug?

thanx for your help,
rico

-- 
 Rico Schiekel   | Logical Tracking&Tracing International AG
 Dipl. Ing. (FH) | Software Development MDA

 Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org

Attachment: signature.asc
Description: Digital signature



Messages sorted by: Reverse Date, Date, Thread, Author