Merge branch 'master' of feistymeow.org:feisty_meow
[feisty_meow.git] / scripts / files / exploder.sh
diff --git a/scripts/files/exploder.sh b/scripts/files/exploder.sh
new file mode 100644 (file)
index 0000000..6199105
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+parm=$1
+
+#echo original parm is: $parm
+# turn the form that is just two characters of /X into X:/.
+parm=$(echo $parm | sed -e 's/^\/\([a-zA-Z]\)$/\1:\//g')
+#echo parm now is $parm
+# turn the msys path form into an msdos style path for the drive letter.
+parm=$(echo $parm | sed -e 's/^\/\([a-zA-Z]\)\//\1:\//g')
+#echo parm now is $parm
+# turn the form that is /cygdrive/X into X:/.
+parm=$(echo $parm | sed -e 's/^\/cygdrive\/\([a-zA-Z]\)$/\1:\//g')
+#echo parm now is $parm
+# turn regular cygwin paths into msdos style paths for the drive letter.
+parm=$(echo $parm | sed -e 's/^\/cygdrive\/\([a-zA-Z]\)\//\1:\//g')
+#echo parm now is $parm
+# rip off any slashes on the end, if they aren't too close to a colon.
+parm=$(echo $parm | sed -e 's/\([^:]\)\/*$/\1/g')
+#echo parm now is $parm
+# turn linux forward slashes into dos backward slashes.
+parm=$(echo $parm | sed -e 's/\//\\/g')
+#echo "totally chewed parm is: $parm"
+
+$WINDIR/explorer "$parm"
+