[ale] How to expand to full-path name?

Jay Loden ale at jayloden.com
Thu Aug 9 12:18:18 EDT 2007



Jay Loden wrote:
> Since bash does not have an abspath or equivalent function, the only other way I
> can think of to do this is:
> 
> script_home=`python -c "import os; print os.path.abspath(\"$(dirname $0)\")"`
> 
> or if you prefer Perl:
> 
> script_home=`perl -e "use Cwd 'abs_path'; print abs_path(\"$(dirname $myscript)\")"`
> 
> -Jay

Bah, that second example was meant to have $0 in place of $myscript, the
myscript variable was just what I used to test with, sorry for the confusion.

-Jay



More information about the Ale mailing list