Linux.com

Home Linux Community Forums Software Command Line .bat to shell script...pls translate

.bat to shell script...pls translate

Link to this post 19 Jun 09

hi,
im new to scripting:-(i badly need to translate this one.
can anyone help me with this.

in my 'init.bat' file i have this script


set CLASSPATH=\dev\xdk\lib\xmlparserv2.jar
set CLASSPATHJ=\dev\xdk\lib\xmlparserv2.jar


and in my 'go.bat' file i have this.

rem java -classpath .;\dev\xdk\lib\xmlparserv2.jar oracle.xml.parser.v2.oraxsl parser.xslt parser.xslt
rem java oracle.xml.parser.v2.oraxsl parser.xslt parser.xslt
rem java oracle.xml.parser.v2.oraxsl IBDE_BPI_PH_en.xsl Format_Payment_Instructions_200309.xml

java oracle.xml.parser.v2.oraxsl -s IBDE_BPI_PH_en.xsl -l Format_Payment_Instructions_200309.xml -r txt
type Format_Payment_Instructions_200309.xml.txt

this two batch files converts xml file('Format_Payment_Instructions_200309.xml') and xsl file to a txt file.
now i have to put this 2 scirpts together in my shell script which contains this lines

EMAIL="--------"--
BCC="-------------"

cd /home/ebanking/BPI/bin

for FILE in `ls -1 ../out/*.xml` ; do
echo moving $FILE
mv ../out/$FILE ../xml/$FILE
done


for FILE in `ls -1 ../out` ; do
echo Renaming $FILE
mv ../out/$FILE ../out/$FILE.txt
FILE=$FILE.txt

unix2dos -n ../out/$FILE ../sent/$FILE
rm ../out/$FILE
chmod 775 ../sent/$FILE
echo Transmitting $FILE
mutt -s "[EBS] bpi: batch $FILE" -a ../sent/$FILE $EMAIL -b $BCC < /dev/null
done


thanks in advance for those who can help.


-newbie

Link to this post 20 Jun 09

The set shell command only sets a local variable, which will be invisible to sub-scripts, such as go.bat. You need to export them instead. Ie,


export CLASSPATH=devxdklibxmlparserv2.jar
export CLASSPATHJ=devxdklibxmlparserv2.jar

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board