top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

External process Invoking shell script with java

+2 votes
190 views

We have a shell script RunIndexer.sh with the following content. The indexer.jar application takes two parameters which are true and true.

java -jar indexer.jar true true

Executing the shell script from the shell works perfectly fine. But when we have Informatica invoke it, it does not seem to be doing anything. I played a bit with the script and found that Informatica is able to invoke java and is able to see indexer.jar; but the application does not get executed at all. I checked for it in ps -ef as well.

What could be happening? Thank you

posted Oct 8, 2014 by Sachin

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

When executing the shell script from Informatica Command Task or Post Session, you have to make a note of these points: 1. Give absolute path to that script. 2. Don't forget to explicitly mention the shell name in which you want your script to run in i.e.(#!/bin/sh/). 3. One more thing can be checked if the user from which informatica is trying to run script has the permissions to run java code.

answer Oct 13, 2014 by Shweta Singh
Similar Questions
0 votes

am writing a post session shell script where i have to count the target which is a flat file row count and if the count is greater then 500 then send a mail notifying the same. But there are some errors in the script.

DIR="/data/research_dev/inbfiles"
cd /data/research_dev/inbfiles
if [ "$(wc -l ff_invoicepreviewqueue1.csv)" > 500 ]; then
echo "Hi," > InvoicePreview.dat
echo " The row count of InvoicePreviewQueue is:   " >> InvoicePreview.dat
#wc -l ff_invoicepreviewqueue1.csv >> InvoicePreview.dat
echo "                  " >> InvoicePreview.dat
echo "            " >> InvoicePreview.dat
echo "Thanks and Regards," >> InvoicePreview.dat
echo "BI Support team." >> InvoicePreview.dat
mailx -s "Alert!! Count is out of limits!! " "correia.blossom@rexelholdingsusa.com" < InvoicePreview.dat
rm -f InvoicePreview.dat.dat
#
+1 vote

I am relatively new to shell scripting and UNIX. I am using a Solaris box and the problem is that we have a shell script called strtwrfl.sh which takes a parameter as the workflow name and starts the workflow, e.g. ./strtwrfl.sh ABC where ABC is the workflow name.

I have to run over 200 of such workflows, each workflow is dependent on the successful completion of the previous workflow, i.e. if there are 2 workflows ABC and BCD, strtwrfl.sh BCD will be successful only if strtwrfl.sh ABC successfully executed.

Each workflow takes different time to execute successfully.

I have to write a single shell script such that those 200+ informatica workflows must (I dont mind manually entering those workflows into the script) execute one after another, and if one fails the script should halt displaying which workflow failed.

Since this is a production environment I will not be able to share strtwrfl.sh here.

0 votes

we have two informatica jobs that run parallel . one starts at 11.40 cet and it has around 300 informatica workflows in it out of which one is fact_sales. the other job runs at 3.40 cet and it has around 115 workflows in it many of which are dependent on fact_sales in term of data consistency. the problem is fact_sales should finish before certain workflows in process 2 starts for data to be accurate. but this doesnt happen generally. what we are trying to do is to split the process 2 in such a way that fact_sales dependent workflows run only after the fact_sales has finished . can you provide me a way to go about writing a unix shell script that check the status of this fact_sales and if it successfull then kicks off other dependent workflows and if not then it should send a failure mail.

Thanks

+2 votes

Suppose I have a C code which has for loop at multiple place but for some reason we want to replace all for loop with the while loop. Can someone help me with shell script which can do such magic?

...