Skip to content

Instantly share code, notes, and snippets.

@fitnr
Created January 8, 2015 17:14
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 fitnr/e4f95ce417fb8e11bfa7 to your computer and use it in GitHub Desktop.
Save fitnr/e4f95ce417fb8e11bfa7 to your computer and use it in GitHub Desktop.
Bash script to get an absolute filename from a relative filename
#!/bin/sh
# $1 : relative filename
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment