- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: What is the $$ for?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
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
тАО06-25-2004 02:29 AM
тАО06-25-2004 02:29 AM
LOG=/tmp/log-trimmer.$$
what does the $$ stand for??
thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2004 02:32 AM
тАО06-25-2004 02:32 AM
Re: What is the $$ for?
$$ - process number of current process
can someone elaborate.
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2004 02:32 AM
тАО06-25-2004 02:32 AM
Re: What is the $$ for?
Regards,
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2004 02:35 AM
тАО06-25-2004 02:35 AM
SolutionIt's use in this case is to ensure that the script has a unique filename.
eg if you run that script twice, one may use filename log-trimmer.4457, and the other log-trimmer.4459, therefore they won't conflict with each others files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2004 02:35 AM
тАО06-25-2004 02:35 AM
Re: What is the $$ for?
This is your current process id
#echo $$
28722
In this case must correspond at your telnet session shell ID:
#ps
PID TTY TIME COMMAND
28722 pts/tp 0:00 sh
28721 pts/tp 0:00 telnetd
25808 pts/tp 0:00 ps
Rgds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2004 02:36 AM
тАО06-25-2004 02:36 AM
Re: What is the $$ for?
As mentioned it gives the current PID. It is often used in shell scripts to create a unique temporary file name. To be safe there should be a line just before that which removes that filename, which prevents the script from using an existing file which could be left over from a previous run of the script, or could be planted by a malicious user or script.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2004 02:37 AM
тАО06-25-2004 02:37 AM
Re: What is the $$ for?
This number can be used by e.g kill to terminate the process.
Regards,
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2004 02:38 AM
тАО06-25-2004 02:38 AM
Re: What is the $$ for?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2004 04:44 AM
тАО06-28-2004 04:44 AM
Re: What is the $$ for?
makes a good point about "uniq" files.
${$} works most of the time.
LOG=/tmp/log-trimmer.$$
could be rewritten as:
log=$(mktemp -d /tmp -p log-trimmer)
rory
- Tags:
- mktemp