|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
$$ value changes often
May i know why $$ changes often? Code:
bash-2.05b$ perl -e'print "$$\n"' 4444236 bash-2.05b$ echo $$ 4100348 bash-2.05b$ perl -e'print "$$\n"' 4431936 bash-2.05b$ echo $$;perl -e'print "$$\n"' 4100348 4268078 Thanks |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Notice that 4100348 does not change, as this is your current shell. The other numbers are the PID or the various perl interpreter processes that get started..
|
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
try this for current shell pid Code:
typeset -x x=$$ ; perl -e 'print "$ENV{x}\n"' |
| Sponsored Links | ||
|