$$$ in command line
When I enter (echo "I would like lots of $$$") without the parentheses - the number that is displayed in the response is supposed to represent what value?
|
From 'man bash'
Quote:
|
$$ points to process-id of currently running process i.e. shell.
Let's say if you have login into some system using ssh, and entered into a new shell. Then you can find process-id of that process as, Code:
~$ ps -ef | grep ssh Code:
~$ echo $$ Use of more $ characters will do nothing, but just repeatedly print the process-ids again and again. For instance: Code:
~$ echo This is $$ |
Quote:
I recently went round and round with "$$" and "$0" and concluded "While the shell or process is running, $0 holds the numerical value of the process ID" "While the shell or process is running, $$ holds the string value of the process name" bash, of course. :) Or is my logic incorrect? |
Quote:
Code:
> echo $0 |
at least I had all the right parts. :)
"While the shell or process is running, $0 holds the string value of the process name" "While the shell or process is running, $$ holds the numerical value of the process ID" Thanks. |
All times are GMT -5. The time now is 02:32 PM. |