You can see system variables by giving command like $ set
http://freeos.com/guides/l
Main Topics
Browse All TopicsHi,
In one of scripts I am looking at there is an output being directed to a file
the notation is like this
grep -v xyz > file1.$$
and then later on they are deleting file1.$$ (that's something else)
I was wondering what does $$ mean, any idea.
Thanks in advance.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You can see system variables by giving command like $ set
http://freeos.com/guides/l
Or rather, parameter expansion is indicated by $
The `$' character introduces parameter expansion, command substitution,
or arithmetic expansion. The parameter name or symbol to be expanded
may be enclosed in braces, which are optional but serve to protect the
variable to be expanded from characters immediately following it which
could be interpreted as part of the name.
${parameter}
The value of parameter is substituted. The braces are required
when parameter is a positional parameter with more than one
digit, or when parameter is followed by a character which is not
to be interpreted as part of its name.
in this case, the name of the parameter is also $
$$ :Process ID of the script itself. The $$ variable often finds use in scripts to construct "unique" temp file names
http://tldp.org/LDP/abs/ht
When you need to create a temp file to capture some output, then you need to have a unique name somehow. When you run a script then a process is created and that process has a unique id for its life time. So, you can always attach the process id to a file name to make it unique at that time. Each process has a set of env variables and its process id is referred to by $. env variables values are accessed via evaluation operator $. so to get the process id you use $$.
Business Accounts
Answer for Membership
by: ozoPosted on 2009-03-18 at 11:27:42ID: 23921935
man sh
$ Expands to the process ID of the shell. In a () subshell, it
expands to the process ID of the current shell, not the sub-
shell.