Find the answer to your Linux question:
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 ...
  1. #1
    Just Joined!
    Join Date
    Dec 2009
    Posts
    3

    Smile 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.

  2. #2
    Just Joined!
    Join Date
    Dec 2009
    Posts
    3
    any ideas ??

  3. #3
    Linux Newbie
    Join Date
    Sep 2005
    Location
    CZ
    Posts
    164

    Lightbulb

    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


  4. #4
    Just 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...