#!/usr/bin/perl -w use strict; my $ppid = getppid(); my $shell = `/usr/bin/ps -p $ppid`; $shell = (split(/\s+/, $shell))[$#_]; print qq(The parent pid is $ppid\n); print qq(The name of the parent shell is $shell\n);