Set Current Working Directory To Parent Path Of Bash Shell Script

Posted By Weston Ganger

I needed to reference another relative script from another script. This is fairly common. Heres how to set this up for your bash scripts.

parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$parent_path"

Related External Links:

Article Topic:Software Development - Linux

Date:August 26, 2020