Let\'s assume I have 3 shell scripts:
script_1.sh
#!/bin/bash ./script_3.sh
script_2.sh
Declare this:
PARENT_NAME=`ps -ocomm --no-header $PPID`
Thus you'll get a nice variable $PARENT_NAME that holds the parent's name.