Chris@215: #!/bin/bash Chris@269: p=`dirname $0` Chris@215: echo Args are: $@ 1>&2 Chris@215: if [ "$#" -lt 3 ]; then Chris@215: echo Insufficient arguments: $@ Chris@215: exit 2 Chris@215: fi Chris@215: while [ "$#" -gt 3 ]; do Chris@215: shift Chris@215: done Chris@269: out="$1" Chris@269: left="$1" Chris@269: ancestor="$2" Chris@269: right="$3" Chris@269: found="" Chris@269: for d in kdiff3 kdiff3.exe; do Chris@269: if [ -x "$p/$d" ]; then Chris@269: found=true Chris@269: "$p/$d" "$ancestor" "$left" "$right" -o "$out" Chris@269: break Chris@274: elif [ -x "$(type -path $d)" ]; then Chris@274: found=true Chris@274: "$d" "$ancestor" "$left" "$right" -o "$out" Chris@274: break; Chris@269: fi Chris@269: done Chris@269: if [ -z "$found" ]; then Chris@269: fm=/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge Chris@269: if [ -x "$fm" ]; then Chris@292: found=true Chris@269: "$fm" -left "$left" -merge "$out" -ancestor "$ancestor" -right "$right" Chris@269: fi Chris@269: fi Chris@292: [ -n "$found" ]