Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 292 Bytes

File metadata and controls

10 lines (7 loc) · 292 Bytes

Bash get script directory

Back

In Bash the current script directory can be found as follows, this is important when sourcing a script relative to the parent script into execution

script_dir=$(dirname "${BASH_SOURCE[0]}")
source $script_dir/script_2.sh