Monday, August 27, 2012

How could you determine the directory a shell script is in?

#!/usr/bin/sh -f

_DIR=`dirname "$(readlink -f $0)"`
echo ${_DIR}

No comments :