Results 1 to 4 of 4
i want away to know which file called the script
i have a bash shell script , a php file calls this script .
i need to make sure the ...
- 12-17-2009 #1Just Joined!
- Join Date
- Dec 2009
- Posts
- 3
how to find the caller of the script
i want away to know which file called the script
i have a bash shell script , a php file calls this script .
i need to make sure the the file is always called from this php
and no other way
please advice.
- 12-21-2009 #2Just Joined!
- Join Date
- Dec 2009
- Posts
- 3
any ideas ??
- 12-21-2009 #3Linux Newbie
- Join Date
- Sep 2005
- Location
- CZ
- Posts
- 164
Yeah, just an idea:
var_arithmetic.sh:
#! /bin/bash -x
caller.sh
caller.sh:
#! /bin/bash -x
pstree -A | grep `basename $0`
[Lost_scrib@localhost ~]$ var_arithmetic.sh
output: |-gnome-terminal-+-bash---var_arithmetic.---caller.sh---pstree
- 12-21-2009 #4Just Joined!
- Join Date
- Dec 2009
- Posts
- 3
Thanks Lost_scrib
i used this way , but i was using redhat 4,so the option A was not exist , so i didn't reach the orginal file
i applied the way u did on fedora , it works .
Appreciated


Reply With Quote