Mailinglist Archive: opensuse (2835 mails)

< Previous Next >
Re: [opensuse] Which Shell do I Have?
  • From: Randall R Schulz <rschulz@xxxxxxxxx>
  • Date: Tue, 5 Dec 2006 21:11:23 -0800
  • Message-id: <200612052111.23659.rschulz@xxxxxxxxx>
On Tuesday 05 December 2006 19:19, Kai Ponte wrote:
> ...
>
> > ls -l /proc/$$/exe
>
> kai@sith:~> 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: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >