#!/bin/sh # # explorer-here - start an explorer.exe in . or the given directory # # $Id$ Die() { echo Fatal error: $@ >&2; exit 1; } type run.exe >/dev/null || Die cannot find run.exe, are you on Cygwin\? SYSTEMDRIVE=${SYSTEMDRIVE:-'C:'} WINDIR=${WINDIR:-${SYSTEMDRIVE}'\windows'} [ -d "$WINDIR" ] || Die cannot find WINDOWS directory $WINDIR explorer="$WINDIR\\explorer.exe" [ -x "$explorer" ] || Die cannot find EXPLORER executable $explorer [ $# -eq 0 ] && set . for d in "$@" do [ -d "$d" ] || d=`dirname "$d"` run -p "$d" $explorer `cygpath -w "$d"` done