I am currently looking for a software/web development job preferably as a Rails-based developer.
Please email me at weston@westonganger.com. Thanks in advance for any leads!

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

Recommended Posts