Solved

batch to .sh

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mapAB Challlenge 35 126
wordmultiple challenge 12 119
add some character at the end of line in vi 7 63
Excel file not created as expected 7 50
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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…

920 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

16 Experts available now in Live!

Get 1:1 Help Now