Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Can a bash script know which other script called it?

    If you have many scripts which may at some point run the script "", and for some reason you want to keep track of this, is there a way to embed some code in the "foofoo" script so that it generates a log that would look something like:

    9:00 - - parameters
    10:00 - cron - parameters 2
    12:00 - - parameters
    15:00 - at - parameters 3

    I know that "parameters" would be "$*" but I have no idea to know "who" called. The time it happened is eye-candy and I can easily solve it, I'm really interesting in knowing who called the script.

    Openbox + tint2 desktop. Debian testing, liquorix kernel

  2. #2

  3. #3

    Keyword to remember when searching for stuff like that, "built-in variable".
    Openbox + tint2 desktop. Debian testing, liquorix kernel

  4. $spacer_open

Posting Permissions

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