Skip to content

Instantly share code, notes, and snippets.

@cig0
Created February 13, 2015 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cig0/32d16da4a7c69c30f664 to your computer and use it in GitHub Desktop.
Save cig0/32d16da4a7c69c30f664 to your computer and use it in GitHub Desktop.
Convert absolute path to relative
CURPATH=$(pwd)
dir="/"
file=""
FILECHANGE=${dir}${file}
# convert absolute path to relative
FILECHANGEREL=$(echo "$FILECHANGE" | sed 's_'$CURPATH'/__')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment