Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parameter $$1,$$2 1

Status
Not open for further replies.

jazie

Programmer
Jun 17, 2004
5
US
I was reading a unix script written by someone else and came across this type of parameter passing $$1 (notice double dollar sign and not single). Does anyone know what this means? I'm familiar with the single $ but not $$.

Thanks
 
I guess something like eval myVar=\$$1
So $1 contains the name of an environment variable the script reads into myVar

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
nope.

$$ - pid of a process

$$1 - pid of a process suffixed with '1'

echo $$1

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Kudos to PHV and vgersh99! pid of a process makes sense with the script. Thanks!
 
could you post the script (if it is not too large). This is the first time I see that and I'm wondering how do you use it.

Cheers.
 
The script is quite long and it would not make sense if I post a snippet of it, but here is a very simple example in ksh.

print "the PID of the current process is $$"

my script concatenate $$ with a prefix parameter, i.e. $$($var)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top