# Following path conversion functions assume that cygrdives are mounted at root. # Your fstab entry should look like this: # # none / cygdrive binary,posix=0,noacl,user 0 0 # declare -A _CYGDRIVEMAP=([C]="/c" [P]="/p") # Convert mixed path to unix path. Mixed path is using windows drive at the beginning, # but with forward slashes already to_unix_path () { local _DRIVE if [ "${1#[A-Z]:/}" != "$1" ]; then _DRIVE="${1:0:1}" echo "${_CYGDRIVEMAP[$_DRIVE]}${1:2}" return fi echo $1 } # Example call echo $(to_unix_path "C:/Users/starstuck")