How to Get Directory Where Bash Script is Located From Within the Script

When writing Bash scripts, it’s often necessary to access the directory where the script is located from within the script itself. This is particularly useful when working with relative paths or when executing other scripts