Solved

batch to .sh

Posted on 2009-05-12
1
332 Views
Last Modified: 2013-12-27
I have a Windows batch file which I need to execute on Solaris. I am trying to convert it to .sh since batch does not execute on Solaris

Here is the windows file

--------
echo off
setlocal
set ECLIPSE="C:\Composer"
set BUILDWORKSPACE="C:\Composer\build_workspace"
set BUILDFILE="R:\Smart_Container\Main\buildEnv\DARBuild.xml"
set INSTALLFILE="R:\Smart_Container\Main\buildEnv\DARInstall.xml"
set DARPROJECTSDIR="R:\Smart_Container\Main\darProjects"
set INSTALLWORKSPACE="c:\Composer\install_workspace"
rmdir /S /Q %BUILDWORKSPACE%
rmdir /S /Q %INSTALLWORKSPACE%
xcopy %DARPROJECTSDIR% %BUILDWORKSPACE% /E /I
java cp
%ECLIPSE%\startup.jar org.eclipse.core.launcher.Main
data
%BUILDWORKSPACE% application
org.eclipse.ant.core.antRunner
buildfile
%BUILDFILE%
java cp
%ECLIPSE%\startup.jar org.eclipse.core.launcher.Main
data
%INSTALLWORKSPACE% application
org.eclipse.ant.core.antRunner
buildfile
%INSTALLFILE%
--------

I have done the following in .sh

--------------
echo off
setlocal
set ECLIPSE="/Composer"
set BUILDWORKSPACE="/Composer/build_workspace"
set BUILDFILE="/usr/local/Smart_Container/Main/buildEnv/DARBuild.xml"
set INSTALLFILE="/usr/local/Smart_Container/Main/buildEnv/DARInstall.xml"
set DARPROJECTSDIR="/usr/local/Smart_Container/Main/darProjects"
set INSTALLWORKSPACE="/Composer/install_workspace"
rmdir /S /Q $BUILDWORKSPACE
rmdir /S /Q $INSTALLWORKSPACE
xcopy $DARPROJECTSDIR $BUILDWORKSPACE /E /I
java cp
$ECLIPSE/startup.jar org.eclipse.core.launcher.Main
data
$BUILDWORKSPACE application
org.eclipse.ant.core.antRunner
buildfile
$BUILDFILE
java cp
$ECLIPSE/startup.jar org.eclipse.core.launcher.Main
data
$INSTALLWORKSPACE application
org.eclipse.ant.core.antRunner
buildfile
$INSTALLFILE
--------------

But does not seem to be working. Can someone please help.
Thank you
0
Comment
Question by:anshul9189
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 48

Accepted Solution

by:
Tintin earned 125 total points
ID: 24363201
This should get you a little closer.
#!/bin/sh
ECLIPSE=/Composer
BUILDWORKSPACE=/Composer/build_workspace
BUILDFILE=/usr/local/Smart_Container/Main/buildEnv/DARBuild.xml
INSTALLFILE=/usr/local/Smart_Container/Main/buildEnv/DARInstall.xml
DARPROJECTSDIR=/usr/local/Smart_Container/Main/darProjects
INSTALLWORKSPACE=/Composer/install_workspace
 
rm -fr $BUILDWORKSPACE
rm -fr $INSTALLWORKSPACE
 
cp -rp $DARPROJECTSDIR $BUILDWORKSPACE
 
# Not sure about your java stuff
java cp
$ECLIPSE/startup.jar org.eclipse.core.launcher.Main
data
$BUILDWORKSPACE application
org.eclipse.ant.core.antRunner
buildfile
$BUILDFILE
java cp
$ECLIPSE/startup.jar org.eclipse.core.launcher.Main
data
$INSTALLWORKSPACE application
org.eclipse.ant.core.antRunner
buildfile
$INSTALLFILE

Open in new window

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Suggested Courses

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question