On Tuesday 05 December 2006 19:19, Kai Ponte wrote:
> ...
>
> > ls -l /proc/$$/exe
>
> [EMAIL PROTECTED]:~> ls -l /proc/$$/exe
> lrwxrwxrwx 1 kai users 0 2006-12-05 19:18 /proc/4165/exe -> /bin/bash
>
>
> Very cool.  No clue what all that means, but it looks important. :)

$$ is expanded by the shell to its own (decimal) process ID (in ASCII). 
Every active process has an entry in /proc corresponding to its decimal 
process ID (in ASCII). Each process is reflected in a numeric 
sub-directory in /proc and among the entries in that directory is a 
symbolic link called "exe" that references the executable file of the 
program that is being executed in that process.

Voila!

Run "ls -lF /proc/$$" to see what other per-process, reflexive goodies 
are available. Some of the names are suggestive of their meanings.


RRS
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to