In ruby what does “$$” mean?

前端 未结 3 1273
一个人的身影
一个人的身影 2021-01-27 23:39

In my rails console:

$$
#=> 12680

in IRB in other tab:

$$
#=> 15550

What does $$ stands fo

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-28 00:31

    From "Ruby Programming/Syntax/Variables and Constants":

    $$ - $PROCESS_ID, $PID or Process.pid - The process number of the Ruby running this script.
    

提交回复
热议问题