Skip to content

Instantly share code, notes, and snippets.

@jacob414
Created October 13, 2011 18:18
Show Gist options
  • Save jacob414/1285006 to your computer and use it in GitHub Desktop.
Save jacob414/1285006 to your computer and use it in GitHub Desktop.
Absolute path in shell scripts
#!/bin/sh
ME=$(dirname $0)
function abspath {
B=`basename "$1"`
echo "`cd \"$ME\" 2>/dev/null && pwd || echo \"$D\"`/$B"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment