2

I have a shell script written in eclipse

#!/bin/sh
#
# 07/28/2006. .sh file for the Hpims Cron job.
# Runs daily.


. /db2/db2inst1/sqllib/db2profile

APPHOME=/devl/prod/vehmgr/cronjob/HpimsCron
JAVA_HOME=/usr/java14
JAVA_EXEC=$JAVA_HOME/bin/java
JAVAC=$JAVA_HOME/bin/javac

#export APPHOME JAVA_HOME JAVA_EXEC JAVAC
export JAVA_HOME JAVA_EXEC JAVAC

cd $APPHOME

 CLASSPATH=$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/jre/lib/i18n.jar:/appl/jConnect/classes
/jconn2.jar:/appl/net/jserv-1.1.2/libexec/jndi.jar
CLASSPATH=$CLASSPATH:/appl/net/jserv-1.1.2/libexec/mail.jar:/appl/net/jserv-1.1.2/libexec/mailapi.jar:/appl/net/jserv-1.1.2/libexec/activation.jar
CLASSPATH=$CLASSPATH:/appl/net/jserv-1.1.2/libexec/smtp.jar:/appl/net/jserv-1.1.2/libexec/soap.jar:/appl/net/jserv-1.1.2/libexec/ldap.jar
CLASSPATH=$CLASSPATH:/home/db2inst1/sqllib/function:/home/db2inst1/sqllib/java/db2java.zip
CLASSPATH=$CLASSPATH:.
CLASSPATH=$CLASSPATH:/devl/prod/vehmgr/cronjob/HpimsCron

export CLASSPATH


#cd $APPHOME

#$JAVAC HpimsCron.java

$JAVA_EXEC HpimsCron

Question is - how to execute this shell script on Windows XP. I have made changes to the HpimsCron.java file and now I need to run this shell script manually to see the changes reflected.

Anonymoose
  • 5,662
  • 4
  • 33
  • 41

4 Answers4

1

In general I'd do the following:

CLASSPATH=something
CLASSPATH=$CLASSPATH:something/else
export CLASSPATH

Becomes

set CLASSPATH=something
set CLASSPATH=%CLASSPATH%;something\else

(note, the ; instead of : and \ instead of /)

EDIT:

The call to dbprofile suggests another script that may not be portable and whether the app (HpimsCron) would work on Windows is also highly dubious.

beny23
  • 34,390
  • 5
  • 82
  • 85
1

Cygwin will allow you to run shell commands on Windows. This post How do you run a crontab in Cygwin on Windows? also explains how to get cron working on Windows under Cygwin.

Community
  • 1
  • 1
matt freake
  • 4,877
  • 4
  • 27
  • 56
0

This won't run under Windows, it's Unix shell specific

moodywoody
  • 2,149
  • 1
  • 17
  • 21
0

You might give Cygwin a try. It offers a Unix-like environment on a Windows system.

Anonymoose
  • 5,662
  • 4
  • 33
  • 41