On 25.11.2020 15:18, KAVALAGIOS Panagiotis (EEAS-EXT) wrote:
---------
   if [ -n "`uname -s |grep -i cygwin_`" ]; then
   # If we are on an new version of Cygnus we need to turn <letter>:/ in
   # the path to/cygdrive/<letter>/
     CYGDRIVE=`mount -p | tail -1 | awk '{print $1}' | sed -e 's%/$%%'`
     WL_HOME_CYGWIN=`echo $WL_HOME | sed "s#\([a-zA-Z]\):#${CYGDRIVE}/\1#g"`
     ANT_HOME_CYGWIN=`echo $ANT_HOME | sed "s#\([a-zA-Z]\):#${CYGDRIVE}/\1#g"`
     PATCH_PATH_CYGWIN=`echo $PATCH_PATH | sed 
"s#\([a-zA-Z]\):#${CYGDRIVE}/\1#g"`
     JAVA_HOME_CYGWIN=`echo $JAVA_HOME | sed "s#\([a-zA-Z]\):#${CYGDRIVE}/\1#g"`
     JRE_HOME_CYGWIN=`echo $JRE_HOME | sed "s#\([a-zA-Z]\):#${CYGDRIVE}/\1#g"`
Hi.

Hard to say why Oracle's script is written this way. Standard Cygwin tool for file names conversion is cygpath. Instead of using sed, one can write
WL_HOME_CYGWIN=`cygpath -u $WL_HOME`
- simpler and the result will be more consistent. Example

$ WL_HOME='C:\some\dir\subdir'            # Windows path
$ echo "$WL_HOME" | sed "s#\([a-zA-Z]\):#/cygdrive/c/\1#g"
/cygdrive/c/C\some\dir\subdir             # mixed forward and back slashes
$ cygpath -u "$WL_HOME"
/cygdrive/c/some/dir/subdir               # pretty Cygwin path

Vlado


--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to