Informix function return value needs to be captured in shell script


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Informix function return value needs to be captured in shell script
# 1  
Old 04-14-2005
Informix function return value needs to be captured in shell script

I need to run a 4ge from within my shell script and capture the string value that is being returned into a unix variable. I have tried the back ticks to no avail. I know it is returning because I did get the returned value to go to my screen at one point..

What I have is:
sendlist = `/usr4/dbase/pas/Bin/rpts_mail2.4ge $t $i`.

This is not working..

Please help!! Thanks!
# 2  
Old 04-14-2005
Quote:
Originally Posted by jeniferz
I need to run a 4ge from within my shell script and capture the string value that is being returned into a unix variable. I have tried the back ticks to no avail. I know it is returning because I did get the returned value to go to my screen at one point..

What I have is:
sendlist = `/usr4/dbase/pas/Bin/rpts_mail2.4ge $t $i`.

This is not working..

Please help!! Thanks!
is the output [i.e. 'return value'] being sent to stdout OT stderr?

try from the command line:
/usr4/dbase/pas/Bin/rpts_mail2.4ge $t $i 2> /dev/null

Do you see the value on your screen?
# 3  
Old 04-14-2005
Quote:
Originally Posted by jeniferz
What I have is:
sendlist = `/usr4/dbase/pas/Bin/rpts_mail2.4ge $t $i`.

This is not working..

Please help!! Thanks!
Try with no spaces:
Code:
sendlist=`/usr4/dbase/pas/Bin/rpts_mail2.4ge $t $i`

# 4  
Old 04-15-2005
Quote:
Originally Posted by vgersh99
is the output [i.e. 'return value'] being sent to stdout OT stderr?

try from the command line:
/usr4/dbase/pas/Bin/rpts_mail2.4ge $t $i 2> /dev/null

Do you see the value on your screen?
There was no value on my screen - I set t=FPOP and i=TEST, I know that a value is found in the rpts_mail2.4ge, but it doesn't show on my screen.

I tried
/usr4/dbase/pas/Bin/rpts_mail2.4ge $t $i 1>tstmail.out 2> /dev/null

and got the correct value in the file.

What am I doing wrong?
Thanks!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Function - Make your function return an exit status

Hi All, Good Day, seeking for your assistance on how to not perform my 2nd, 3rd,4th etc.. function if my 1st function is in else condition. #Body function1() { if then echo "exist" else echo "not exist" } #if not exist in function1 my all other function will not proceed.... (4 Replies)
Discussion started by: meister29
4 Replies

2. Shell Programming and Scripting

Return: can only `return' from a function or sourced script

Not sure where the problem is. I can run the script without any issue using the following command. . /opt/app/scripts/cdc_migration.sh But it fails with the below error when I try it this way /opt/app/scripts/cdc_migration.sh /opt/app/scripts/cdc_migration.sh: line 65: return: can only... (1 Reply)
Discussion started by: svajhala
1 Replies

3. Shell Programming and Scripting

Shell Scripting Function call return value

Hi I have a function : Make_Report() { trx_report=`sqlplus -s $conn_str << @@ set echo off; set pages 0; set feedback off; set verify off; select srv_trx_s_no,... (1 Reply)
Discussion started by: neeraj617
1 Replies

4. Shell Programming and Scripting

[Solved] Output in bash script not captured in variable

I'm tring to write down a simple script that would execute a command and wait until it returns a specific result. This is what i did: bjobs_out=`bjobs` while ]; do bjobs_out=`bjobs` sleep 6 done It seems to work until the command 'jobs' return the list of jobs in execution, but... (4 Replies)
Discussion started by: lifedj
4 Replies

5. Shell Programming and Scripting

SHELL SCRIPT Function Calling Another Function Please Help...

This is my function which is creating three variables based on counter & writing these variable to database by calling another function writeRecord but only one record is getting wrote in DB.... Please advise ASAP...:confused: function InsertFtg { FTGSTR="" echo "Saurabh is GREAT $#" let... (2 Replies)
Discussion started by: omkar.sonawane
2 Replies

6. Shell Programming and Scripting

How to return a value of a variable from shell script to perl script

HI , Is there any way to return a value of variable from shell to perl script. Code: === Perl file my $diff1=system("sh diff.sh"); my $diff2=system("sh diff1.sh"); I need exit status of below commands i.e 0 and 1 respectively. Since in both the cases diff is working so system... (3 Replies)
Discussion started by: srkelect
3 Replies

7. Shell Programming and Scripting

Return a value from called function to the calling function

I have two scripts. script1.sh looks -------------------------------- #!/bin/bash display() { echo "Welcome to Unix" } display ----------------------------- Script2.sh #!/bin/bash sh script1.sh //simply calling script1.sh ------------------------------ (1 Reply)
Discussion started by: mvictorvijayan
1 Replies

8. Shell Programming and Scripting

How to return the value from the called shell script to the calling sh script

Hi all, I have two ksh scripts #sample1.sh #!/bin/ksh . ./sample2.sh echo $fileExist #sample2.sh #!/bin/ksh func() { i=1 return $a } func echo $? Here how should I return the value of sample2.sh back to sample1.sh? Thanks in advance. (2 Replies)
Discussion started by: gp_singh
2 Replies

9. Shell Programming and Scripting

How to return value in shell script

im using bourne shell In file scriptA i add a new function, test_return() test_return() { a=1 return $a } when i try execute , a='/''/scriptA test_return echo $a its give me error.. scriptA: cannot return when not in function ist any solution for this problem.. How... (1 Reply)
Discussion started by: neruppu
1 Replies

10. Shell Programming and Scripting

return code not captured

Hi all, We have a script in our Unix box(HP-UX 11.11) which is invoked as script1.sh param1 param2 >>${logfile} script2.sh "param" Actually the script2 is also called from the same line. There is no semicolon between the 2 calls. I also checked the octal dump. What happens here... (2 Replies)
Discussion started by: ranj@chn
2 Replies
Login or Register to Ask a Question