Solved

batch to .sh

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now