Skip to content

Instantly share code, notes, and snippets.

@timlianov
Created May 3, 2017 10:34
Show Gist options
  • Save timlianov/90f073e1daa2d8c52fc773689966a6ac to your computer and use it in GitHub Desktop.
Save timlianov/90f073e1daa2d8c52fc773689966a6ac to your computer and use it in GitHub Desktop.
Relative paths based on file location instead of current working directory
#!/bin/bash
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$parent_path"
cat ../some.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment