#!/bin/bash #filename: openDir.sh #author: Zjmainstay #website: http://zjmainstay.cn #get current dir dir=`pwd` cygwinPath="D:\\\\cygwin" #get drive drive="${dir:10:1}:" #cygwin dir if [ ${dir:1:8} != "cygdrive" ] then drive=$cygwinPath fi #replace cygdrive dir=${dir/\/cygdrive\/[a-z]/} #replace / to \\ dir=${dir//\//\\\\} #connect dir dir=$drive$dir #open dir #explorer $dir ##this is wrong echo "explorer $dir" | sh
未经同意禁止转载!
转载请附带本文原文地址:cygwin中使用Shell打开当前目录,首发自 Zjmainstay学习笔记