Bash : How to check for script being sourced.
This commit is contained in:
parent
50d698fb89
commit
ee9045dc00
5
help/linux/bash/script/CheckIfSourced.md
Normal file
5
help/linux/bash/script/CheckIfSourced.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Bash check for sourced file.
|
||||
|
||||
```bash
|
||||
(return 0 2>/dev/null) && sourced=1 || sourced=0
|
||||
```
|
Loading…
Reference in a new issue