Bash : How to check for script being sourced.

This commit is contained in:
Dmitry Voronin 2024-02-14 17:03:42 +03:00
parent 50d698fb89
commit ee9045dc00

View file

@ -0,0 +1,5 @@
# Bash check for sourced file.
```bash
(return 0 2>/dev/null) && sourced=1 || sourced=0
```