- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- what is $$ ?
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp
Knowledge Base
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2004 10:00 PM
11-08-2004 10:00 PM
no rush with this one!
I'm just curious what the $$ variable is
#> echo $$
24888
some sort of internal sequence number incrementing with each command/login?
thanks in advance
John
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2004 10:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2004 05:56 PM
11-09-2004 05:56 PM
Re: what is $$ ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2004 06:09 PM
11-09-2004 06:09 PM
Re: what is $$ ?
$$ is the PID of the shell from which it is called. I tend to add the date and maybe time onto it ... but thats just me being paranoid ... but when it is used for lockfiles I can easily find lockfiles prior to the last reboot ... but i'm going of at a tagent :P
Regards
Gerhard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2004 06:58 PM
11-09-2004 06:58 PM
Re: what is $$ ?
This should be used with caution: if it's not carefully scripted you can end up with two files appended to each other. I've seen it happen with print files. It caused quite a few scratched heads when a new print was accompanied by a print from several weeks earlier.
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2004 07:25 PM
11-09-2004 07:25 PM
Re: what is $$ ?
appreciate all the responses
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2004 03:43 AM
11-11-2004 03:43 AM
Re: what is $$ ?
Example:
TMP=/var/tmp/work.$$
If several people run the script at the same time, several temp files will be created and they won't stomp on each other, since each person running the script has their own process ID.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2004 06:57 AM
11-11-2004 06:57 AM
Re: what is $$ ?
$$ current PID of this shell
$# number of parameters on the command line
$? return code from the last process run
$! PID of the last process put into the background
$0 name of the current shell or script
$1 value of the first parameter on the command line
$2 $3 etc values of additional parameters on the command line
$* all the parameters on the command line
$@ basically the same as $* ($@ preferred)
Bill Hassell, sysadmin