2

Possible Duplicate:
What does $$ mean in the shell?
What are the Special Dollarsign Variables (Possibly bash Only)?

I am new to linux environment. I am dealing with a particular script that has a command like this

ps -p $$

-p should follow a process id but I don't understand what $$ means. \ Could some linux gurus shed light on it ? isit a var where is it coming frome etc.,,

Thanks

Community
  • 1
  • 1
Ahmed
  • 14,503
  • 22
  • 92
  • 150
  • The special `$`-based variables are described in this other question: http://stackoverflow.com/questions/5163144/what-are-the-special-dollarsign-variables-possibly-bash-only - `$$` itself means this process' PID. – wkl Jun 22 '12 at 17:49
  • Is it a varibale ? when I do env I don't see it ... – Ahmed Jun 22 '12 at 17:51
  • 1
    `env` displays the environment. variables are not the same as environment variables. – William Pursell Jun 22 '12 at 17:53

1 Answers1

2

The special $$ variable evaluates to the current process' PID (process ID) -- it is an integer number; it's not listed by env as it's not an environment variable. It's a special built-in variable provided by BASH.