We have an implementation to set environment for a particular tool with our custom command.
Eg: custom_command tool_name
This command logs the invokation time, user and tool_name in a log file.
And with these logs, we can findout when was a particular tool last used.
Now, users have this habit of putting the command in their login profile.
So, is it possible to findout if a comamnd is invoked by manually typing it on command line or is sourced from another script and if it is, what was the script name?
I have tried multiple ways. All I can findout is the parent script name i.e., the shell.
My understanding is that it is not possible. But I am just trying my luck.