Re: How can I get full filenames from Git difftool (for Microsoft Word “Compare Documents” feature)?
- From
Jeff Epler <jepler@unpythonic.net>
- Date
- Dec 14, 2009, 13:11 UTC
- Message-ID
- <20091214131112.GC22735@unpythonic.net>
- In-Reply-To
- <b507cb050912132225j1bdc39c2v42a3bf6bddf1cb1a@mail.gmail.com>
In the bash shell, you can convert a relative path to absolute by prepending
the directory name:
mkabs () {
case "$1" in
/*) echo "$1" ;;
*) echo "$(pwd)/$1" ;;
esac
}Using it at the shell prompt:
$ mkabs example
/home/jepler/example
$ ls -l $(mkabs example)
-rw-r--r-- 1 jepler jepler 0 2009-12-14 07:08 /home/jepler/exampleIf mac has a gnu-like readlink(1), then use 'readlink -f' instead of the
mkabs shell function:
$ readlink -f example
/home/jepler/exampleYou should be able to write a shell script which does the conversion from relative to absolute using one of these patterns, and then invokes the applescript.
It may turn out that there's a way to convert a path from relative to absolute in applescript as well, but I wouldn't know it.
Jeff