How to check whether script is "main" or "primary"?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to check whether script is "main" or "primary"?

Walter Mundt
Is there any way to check from within a bsh script whether it was
invoked directly via the command line, or sourced from another script or
from the desktop?

I'm looking for something similar in functionality to Python's "if
__name__ == '__main__'" construct.

Walter.Mundt.vcf (308 bytes) Download Attachment