Results 1 to 3 of 3
If you have many scripts which may at some point run the script "foofoo.sh", and for some reason you want to keep track of this, is there a way to ...
- 10-04-2011 #1Linux Newbie
- Join Date
- Apr 2007
- Posts
- 211
Can a bash script know which other script called it?
If you have many scripts which may at some point run the script "foofoo.sh", 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 - autostart.sh - foofoo.sh parameters
10:00 - cron - foofoo.sh parameters 2
12:00 - fooscript.sh - foofoo.sh parameters
15:00 - at - foofoo.sh 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.
Thanks.Openbox + tint2 desktop. Debian testing, liquorix kernel
- 10-04-2011 #2
- 10-04-2011 #3Linux Newbie
- Join Date
- Apr 2007
- Posts
- 211
Thanks!
Keyword to remember when searching for stuff like that, "built-in variable".Openbox + tint2 desktop. Debian testing, liquorix kernel


1Likes
Reply With Quote