I have a small tool which is currently configured in batch scripts only. But my need is to run it on Linux platform, so I have been trying to convert a batch script to shell script.
below is the batch script:
Code:
@echo off
IF "%1"== "" GOTO ARGERR
REM UPDATE THESE PROPERTIES TO MATCH YOUR BART INSTALLATION
REM -------------------------------------------------------
SET BART_HOME=D:\BARTNEW
SET BART_VER=1.5
REM -------------------------------------------------------
REM PROVIDE SYSTEM SPECIFIC INFORMATION
REM ------------------------------------
SET JRE_HOME="C:\java\jre6"
SET BROWSER_EXE="c:\program files\internet explorer\iexplore.exe"
REM ------------------------------------
REM -------------------------------------------------
REM ******* DO NOT MODIFY THE BELOW ENTRIES *********
REM -------------------------------------------------
SET JAVA="%JRE_HOME%\bin\java.exe"
SET BART_LIB_DIR=%BART_HOME%\%BART_VER%\lib
SET XALAN_LIB=%BART_LIB_DIR%\xalan.jar
SET COMMONS_LIB=%BART_LIB_DIR%\commons-collections-3.2.1.jar;%BART_LIB_DIR%\commons-configuration-1.6.jar;%BART_LIB_DIR%\commons-lang-2.4.jar;%BART_LIB_DIR%\commons-logging-1.1.1.jar;%BART_LIB_DIR%\commons-io-1.4.jar;%BART_LIB_DIR%\xmlunit-1.2.jar
SET BART_LIB=%BART_LIB_DIR%\bart.jar
SET BART_RULES_LIB=%BART_LIB_DIR%\bart-rules.jar
SET BART_CP_EXT=%XALAN_LIB%;%COMMONS_LIB%;%BART_LIB%;%BART_RULES_LIB%;
REM -------------------------------------------------
REM CALLOUT TO CUSTOM SCRIPT IF ONE EXISTS
IF EXIST %BART_LIB_DIR%\ext\setenv.bat CALL %BART_LIB_DIR%\ext\setenv.bat
REM -------------------------------------------------
IF NOT EXIST %JAVA% GOTO JAVAERR
%JAVA% -Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl -Dbart.browser.path=%BROWSER_EXE% -classpath %BART_CP_EXT% com.sample.eai.tools.icg.bart.Bart %1
GOTO END
:ARGERR
ECHO Usage : launch "config-filename". Eg. launch bart.cfg
GOTO END
:JAVAERR
ECHO JRE_HOME not set correctly. Unable to locate java.exe
GOTO END
:END
set \p input="Run completed.Press Enter key to return to prompt.."
Basically this gets invoked from command line as
launch.cmd <config-file>
I am currently migrating to ubuntu from my windows system. Now I am learing to convert all my batch scripts into linux shell. Although the common commands are more or less similar, but I found it difficult for the following set of commands in windows cmd:
setlocal
:PROMPT
SET /P... (2 Replies)
Hi team,
My requirement is to transfer pdf files from windows machine to unix server and then from that unix server we should sftp to another server.
I have completed the first part i.e From windows to using to unix server with the help of psftp.exe
code:
psftp user@host -pw password <... (1 Reply)
Hi,
I am a junior dba and started carrier very new. I have a batch file to create some script of db creation. I want that batch file to convert in .sh file so that I can directly run that in the AIX box to generate those files.
Please help me with the code for AIX. Batch file is here:
... (2 Replies)
Hi,
I am just trying to convert the batch script to bash script and i am stuck at one point where I have the below code
for /f "delims=" %%a in (a.txt) do (
for /f "tokens=1,2,3* delims==" %%i in ("%%a") do (
for /f "tokens=1,2,3* delims= " %%x in ("%%i") do (
if... (4 Replies)
while converting batch file to shell script ...dis command is ther i dunno how to change...can anyone knws how to change into shell script
rm !(D:\temp\XX.txt) (3 Replies)
Can anyone help me with a dos batch script to execute a shell script residing in an unix server. I am not able to use ssh.
Thanks in advance (2 Replies)
Hello everyone. I am new to shell scripting and i am required to create a shell script, the purpose of which i will explain below.
I am on a solaris server btw.
Before delving into the requirements, i will give youse an overview of what is currently in place and its purpose.
... (2 Replies)
Hi.
I am trying to write an sh script that will:
1. take each wav file in ~/Documents
2. convert each into mp3 format using "lame" encoder
3. save the new mp3 in ~/Documents/newmp3s.
It has to follow the 3 steps in this order for each wav file before taking the next file.
I tried a... (8 Replies)
Hi,
When I run the below script in UNIX it's throwing syntax errors. Actually it's a windows batch script. Could anyone change the below Windows Batch script to UNIX shell script...
Script:
REM :: File Name : Refresh_OTL.bat
REM :: Parameters : %1 - Region
REM :: : %2 - Cube Type
REM ::... (5 Replies)
How do I execute a batch command from a script, which "waits" with the next command until the first one has finished?
=======
A piece of my script looks like this:
#!/bin/sh
(...)
# run a long batch job:
./run_calculation.sh
# then rename resulting file:
mv output.dat backup.dat
(...)
... (7 Replies)