You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Hensley, Richard" <Ri...@itb.mckhboc.com> on 2001/05/10 05:59:50 UTC

Cygwin Patchs for example shell scripts

I use CYGWIN for most of my development, and it allows the conversion of a
unix path to a Windows path so that you can run programs, like java -cp,
that expect windows paths. I've patched the example .sh files based upon the
build.sh file. Hope somebody else finds this useful also.

Richard Hensley

examples/app_example1
--- example.sh.orig	Tue Apr 10 05:15:38 2001
+++ example.sh	Wed May  9 20:54:56 2001
@@ -1,9 +1,15 @@
 echo "Running Example with input file 'example.vm'"
 
+_VELCP=.
 for i in ../../bin/*.jar
 do
     _VELCP=$_VELCP:"$i"
 done
 
-java -cp $_VELCP:. Example example.vm  
+# convert the unix path to windows
+if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
+    _VELCP=`cygpath --path --windows "$_VELCP"`
+fi
+
+java -cp $_VELCP Example example.vm  
 
examples/app_example2
--- example2.sh.orig	Tue Apr 10 05:16:48 2001
+++ example2.sh	Wed May  9 20:52:07 2001
@@ -5,5 +5,10 @@
     _VELCP=$_VELCP:"$i"
 done
 
+# convert the unix path to windows
+if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
+    _VELCP=`cygpath --path --windows "$_VELCP"`
+fi
+
 java -cp $_VELCP Example2
 
examples/logger_example
--- logger_example.sh.orig	Wed May  9 20:48:04 2001
+++ logger_example.sh	Wed May  9 20:48:15 2001
@@ -5,5 +5,10 @@
     _VELCP=$_VELCP:"$i"
 done
 
+# convert the unix path to windows
+if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
+    _VELCP=`cygpath --path --windows "$_VELCP"`
+fi
+
 java -cp $_VELCP:. LoggerExample 
 
examples/xmlapp_example
--- xmlapp_example.sh.orig	Wed May  9 20:49:51 2001
+++ xmlapp_example.sh	Wed May  9 20:50:23 2001
@@ -10,5 +10,10 @@
     _VELCP=$_VELCP:"$i"
 done
 
+# convert the unix path to windows
+if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
+    _VELCP=`cygpath --path --windows "$_VELCP"`
+fi
+
 java -cp $_VELCP XMLTest xml.vm
 

Re: Cygwin Patchs for example shell scripts

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
done. thanks


"Hensley, Richard" wrote:
> 
> I use CYGWIN for most of my development, and it allows the conversion of a
> unix path to a Windows path so that you can run programs, like java -cp,
> that expect windows paths. I've patched the example .sh files based upon the
> build.sh file. Hope somebody else finds this useful also.
> 
> Richard Hensley
> 
> examples/app_example1
> --- example.sh.orig     Tue Apr 10 05:15:38 2001
> +++ example.sh  Wed May  9 20:54:56 2001
> @@ -1,9 +1,15 @@
>  echo "Running Example with input file 'example.vm'"
> 
> +_VELCP=.
>  for i in ../../bin/*.jar
>  do
>      _VELCP=$_VELCP:"$i"
>  done
> 
> -java -cp $_VELCP:. Example example.vm
> +# convert the unix path to windows
> +if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
> +    _VELCP=`cygpath --path --windows "$_VELCP"`
> +fi
> +
> +java -cp $_VELCP Example example.vm
> 
> examples/app_example2
> --- example2.sh.orig    Tue Apr 10 05:16:48 2001
> +++ example2.sh Wed May  9 20:52:07 2001
> @@ -5,5 +5,10 @@
>      _VELCP=$_VELCP:"$i"
>  done
> 
> +# convert the unix path to windows
> +if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
> +    _VELCP=`cygpath --path --windows "$_VELCP"`
> +fi
> +
>  java -cp $_VELCP Example2
> 
> examples/logger_example
> --- logger_example.sh.orig      Wed May  9 20:48:04 2001
> +++ logger_example.sh   Wed May  9 20:48:15 2001
> @@ -5,5 +5,10 @@
>      _VELCP=$_VELCP:"$i"
>  done
> 
> +# convert the unix path to windows
> +if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
> +    _VELCP=`cygpath --path --windows "$_VELCP"`
> +fi
> +
>  java -cp $_VELCP:. LoggerExample
> 
> examples/xmlapp_example
> --- xmlapp_example.sh.orig      Wed May  9 20:49:51 2001
> +++ xmlapp_example.sh   Wed May  9 20:50:23 2001
> @@ -10,5 +10,10 @@
>      _VELCP=$_VELCP:"$i"
>  done
> 
> +# convert the unix path to windows
> +if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
> +    _VELCP=`cygpath --path --windows "$_VELCP"`
> +fi
> +
>  java -cp $_VELCP XMLTest xml.vm
> 

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
"still climbing up to the shoulders..."