On Sun, Jun 21, 2015 at 3:57 PM, Andrew Miller <address@hidden> wrote:
Eduardo A. Bustamante López <address@hidden> writes:
If you want to explore the process tree, use a tool like ps:
I'm looking to replace the "case $TERM in..." statement in my bashrc with
something more fine-grained.
Since it runs every time bash is launched, and my machine is a 15-year-old
thinkpad, I'd prefer not to call an external program like ps. That adds a
lot
of overhead.
On a system with /proc:
stat=($(</proc/$$/stat)) # create an array
ppid=${stat[3]} # get the fourth field