Forums Register Login

UNIX shell script help

+Pie Number of slices to send: Send
HI,

i have load.bat file in my windows ...
IN WINDOWS
we have a loader.exe file which loads the data in some queue.We keep this data in a particular folder i.e "in" folder. Now this loader.exe file picks the data from the "in" folder and loads it in an MQueue.I dont know exactly how this loader.exe file works but w.r.t this questn i dont think its imp...

Now we created a load.bat file


c:
cd c:/prjct/Java/bin ( )

Loader.exe -t ABC.cfg -f c:/prjct/Java/in/Data
Loader.exe -t DEF.cfg -f c:/prjct/Java/in/Data1




Things in bold above is contained in load.bat file....
as i told you "in" is the folder where we have data which is picked up by loader.exe

ABC.cfg and DEF.cfg files are 2 config files( Since data is in GFF i.e Generic File Format)

IN UNIX
Now i need a shell script which does the same work as "load.bat" . ( I guess i have loader.exe in my unix box...and it works fine....)
i just need a shell script syntax which does the same thing as load.bat file did in windows

[ August 06, 2008: Message edited by: Maan Shenoy ]
[ August 06, 2008: Message edited by: Bear Bibeault ]
+Pie Number of slices to send: Send
Hi! I am not sure if I have understood you well, but if all you want is to start this commands:

Loader.exe -t ABC.cfg -f c:/prjct/Java/in/Data
Loader.exe -t DEF.cfg -f c:/prjct/Java/in/Data1

from a file just put them in a file and make it executable. I.e.

touch loader.sh && chmod +x loader.sh && echo "Loader.exe -t ABC.cfg -f c:/prjct/Java/in/Data" >> loader.sh && echo "Loader.exe -t DEF.cfg -f c:/prjct/Java/in/Data1" >> /loader.sh

Of course you have to adjust paths. Now you could execute it by typing in shell ./loader.sh or sh loader.sh. That is in case you are in dir where is the file. when not just type full path.

If you want to start them upon boot process or periodicaly consider putting that command in some startup script (this depends on distribution. I think /etc/rc.d/rc.local is for debian, ubuntu and /etc/conf.d/local.start on gentoo) or in cron for periodcal executing.
+Pie Number of slices to send: Send


Above shell script is saved as load.sh
now i go to my bin folder and run the load.sh
in unix



/dq5/bin$ load.sh

output
/dq5/bin (because of echo command)

load.sh[12]: /dq5/bin: 0403-006 Execute permission denied.
load.sh[13]: /dq5/bin: 0403-006 Execute permission denied.


Getting execute permission denied error...what is required to be done?
Please I require it as soon as possible....
+Pie Number of slices to send: Send
Have you given the permission to executable?

chmod +x load.sh
+Pie Number of slices to send: Send
thanks freddy....



above shell script works without error but doesnot perform intended operation.Can anyone help in this?

even when i tried giving a file name which doesnot exist ,it ran without any erros but didnot perform the loading which i was expecting to happen......
+Pie Number of slices to send: Send
Can you try to run
/dq5/bin/loader -t abc.cfg -f /dq5/java/data.txt
from your shell and see what happens?
+Pie Number of slices to send: Send
Thanks....

i tried but getting some timestamp issue.That command runs fine but gets some timestamp issue

*** ERROR ***
SQL ERROR occured: Prepare UPDATE.
SQLCODE: -818
SQL0818N A timestamp conflict occurred. SQLSTATE=51003
SQLSTATE 51003: Consistency tokens do not match.
Every snowflake is perfect and unique. And every snowflake contains a very tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2620 times.
Similar Threads
Need unix shell script Help
How to run .class file from Unix shell script
upload file to windows share folder running on unix
Loading images into MySQL via Ant
Starting Glassfish server on system boot
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 06:48:52.