Solved

batch to .sh

Posted on 2009-05-12
1
328 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
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What are recommended OS for exim mail server? 10 110
How to clone solaris 10 machine 33 131
unix solaris snoop command 6 99
x-bar in Google Sheets 2 54
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

777 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