Sponsored Content
Top Forums Shell Programming and Scripting How to return a value of a variable from shell script to perl script Post 302372354 by adderek on Tuesday 17th of November 2009 06:30:49 PM
Old 11-17-2009
StdOut, StdErr - you can catch them.
Return code - a value which is 0 or !0. 0=SUCCESS, !0=FAILURE (according to POSIX). There are exceptions like diff. Return code should be between 0 and 127 but might be different.
There are other possibilities as well... google for inter-process communication.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to use substr to return data into a shell script variable?

I'm writing a shell script in which I need to be able to pull a portion of the file name out. I'm testing with the following code: x="O1164885.DAT" y=`ls -ltr *${x}|awk '{print substr($0,3)}'` echo ${x}|awk '{print substr($0,3)}' echo "y="$y I can echo it to the screen just fine but I... (3 Replies)
Discussion started by: ttunell
3 Replies

2. Shell Programming and Scripting

Perl script variable to read shell command

Solaris 10 Korn shell ksh, Hi there, I have figured out to get yesterday's date which is using the below command: TZ=GMT+24; date +%d-%b-%Y to get the format of 30-Sep-2008 and TZ=GMT+24; date +%Y%m%d to get the format of 20080930. I need this two format. In my perl script below I need... (4 Replies)
Discussion started by: bulkbiz
4 Replies

3. 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

4. Shell Programming and Scripting

Get return value from PERL script calling from KSH

All: I am calling a PERL script from KSH. I need specific codes to be returned by the PERL Script. For ex: Ksh ----- result=`test.pl $FILE` My idea is to get the value of result from the test.pl, by specifically making the test.pl to print the return code. Since I had some other print... (1 Reply)
Discussion started by: ucbus
1 Replies

5. Shell Programming and Scripting

Simple script to return environment variable

HI , In the below script I am trying to return the value of the environment variable TIBCO_HOME to the caller #! /usr/bin/csh set VAR_NAME=$1 echo VAR_NAME On the aix console.. set to setenv TIBCO_HOME /app/tibco When I execute the script... myscript.sh TIBCO_HOME, the script... (5 Replies)
Discussion started by: bce_groups
5 Replies

6. 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

7. Shell Programming and Scripting

Assigning return value of an embedded SQL in a shell script variable

I've a script of the following form calling a simple sql that counts the no of rows as based on some conditions. I want the count returned by the sql to get assigned to the variable sql_ret_val1. However I'm finding that this var is always getting assigned a value of 0. I have verified by executing... (1 Reply)
Discussion started by: MxC
1 Replies

8. Shell Programming and Scripting

Return variable value from a script running in background

I have a script which runs a script in the background. Now the script running in background returns some variable value and i want to catch return value in the parent script. e.g. Parent Script : #!/bin/bash ./Back.sh & pid=$! echo "a=$a" echo "b=$b" echo "d=$((a+b))" wait $pid ... (4 Replies)
Discussion started by: Shaishav Shah
4 Replies

9. Shell Programming and Scripting

Using variable from shell script in perl file

Hey, So I have a shell script that outputs some variables, call them $a and $b. I know in shell scripting if I wanted to use the variables in another shell script I'd do sh code.sh "$a" "$b" How can I do something similar with perl? (2 Replies)
Discussion started by: viored
2 Replies

10. Shell Programming and Scripting

Unable to pass shell script variable to awk command in same shell script

I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist. diff=$1$2.diff id=$2 new=new_$diff echo "My id is $1" echo "I want to sync for user account $id" ##awk command I am using is as below cat $diff | awk... (2 Replies)
Discussion started by: Ashunayak
2 Replies
cosProperty(3erl)					     Erlang Module Definition						 cosProperty(3erl)

NAME
cosProperty - The main module of the cosProperty application DESCRIPTION
To get access to the record definitions for the structures use: -include_lib("cosProperty/include/*.hrl"). This module contains the functions for starting and stopping the application. EXPORTS
install() -> Return Types Return = ok | {'EXIT', Reason} This operation installs the cosProperty application in the IFR. install_db() -> Return Types Return = ok | {'EXIT', Reason} This operation installs data in mnesia necessary for running the cosProperty application. uninstall() -> Return Types Return = ok | {'EXIT', Reason} This operation removes all data in the IFR related to the cosProperty application. uninstall_db() -> Return Types Return = ok | {'EXIT', Reason} This operation removes all data from mnesia related to the cosProperty application. start() -> Return Types Return = ok | {error, Reason} This operation starts the cosProperty application. start_SetDefFactory() -> Return Types Return = Factory | {'EXCEPTION', E} Factory = CosPropertyService::PropertySetDefFactory reference. This operation starts a PropertySetDef Factory. start_SetFactory() -> Return Types Return = Factory | {'EXCEPTION', E} Factory = CosPropertyService::PropertySetDefFactory reference. This operation starts a PropertySet Factory. stop_SetDefFactory(Factory) -> Return Types Factory = CosPropertyService::PropertySetDefFactory reference. Return = ok | {'EXCEPTION', E} This operation stops the supplied PropertySetDef Factory. stop_SetFactory(Factory) -> Return Types Factory = CosPropertyService::PropertySetFactory reference. Return = ok | {'EXCEPTION', E} This operation stops the supplied PropertySet Factory. stop() -> Return Types Return = ok | {error, Reason} This operation stops the cosProperty application. Ericsson AB cosProperty 1.1.13 cosProperty(3erl)
All times are GMT -4. The time now is 09:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy