Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [SOLVED]How to call a unix shell script in processs flow,capture script exit status

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]How to call a unix shell script in processs flow,capture script exit status
 Login/Join
 
Member
posted
Hi

I have to run a Unix script from Data Migrator and capture the exit status of the execution of the script.

I tried solution provided in below old post

How to call a unix shell script in the process flow?

-SET &MYRETURN=SYSTEM(100,'ksh test.ksh,'D10');
-TYPE MYRETURN : &MYRETURN.

The &MYRETURN is always '0' even if script fails.

Is there a way to capture the exit code from Unix Script

Thanks

This message has been edited. Last edited by: Tamra,
 
Posts: 8 | Registered: August 05, 2015Report This Post
Virtuoso
posted Hide Post
Example that uses echo to post a return code:

-* Create and execute a bash script command

-* preset the ruturn file with bad values
EX -LINES * EDAPUT TXT,bshrc,C,FILE
999
EDAPUT*
-RUN

-* build the script file
EX -LINES * EDAPUT TXT,bshscript,C,FILE
#!/usr/bin/ksh
touch /root/test 2> /dev/null
if [ $? -eq 0 ]
then
  echo 000 > bshrc.txt
  exit 0
else
  echo 001 > bshrc.txt
  exit 1
fi
EDAPUT*
-RUN
-* change script to executable
! chmod +x bshscript.txt
! ./bshscript.txt
-RUN

-* evaluate our returncode
-TYPE Showing bshrc
FILEDEF RTNCODE DISK bshrc.txt
-RUN
-READ RTNCODE &BSHRETURN.I3.
-TYPE Our Return Code: &BSHRETURN
-RUN  


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [SOLVED]How to call a unix shell script in processs flow,capture script exit status

Copyright © 1996-2020 Information Builders