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
Sensor(3I)																Sensor(3I)

NAME
Sensor - describe input interest SYNOPSIS
#include <InterViews/sensor.h> DESCRIPTION
A sensor specifies a set of input events to catch. PUBLIC OPERATIONS
Sensor() Create a new sensor that initially will not catch any events. virtual void motion(boolean) Specify the sensor should (parameter is true) or should not (parameter is false) catch pointer motion events. virtual boolean motion() Return whether the sensor is catching pointer motion events. virtual void key(boolean) Specify the sensor should (parameter is true) or should not (parameter is false) catch keyboard events. virtual boolean key() Return whether the sensor is catching keyboard events. virtual void button(boolean, PointerButton = Event::any) Specify the sensor should (parameter is true) or should not (parameter is false) catch button events. The pointer button may spec- ify a particular button or Event::any (meaning all button events). virtual boolean button(PointerButton = Event::any) Return whether the sensor is catching button events. The pointer button may specify a particular button or Event::any (meaning any of the buttons). virtual boolean caught(Event&) Return whether the sensor is catching the given event. void Catch(EventType) Express interest in a particular type of event. This function is provided solely for backward compatibility and will be removed in a future version. void CatchButton(EventType, int) Express interest in a particular type of button event for a specific button. This function is provided solely for backward compati- bility and will be removed in a future version. void Ignore(EventType) Remove interest in a particular type of event. This function is provided solely for backward compatibility and will be removed in a future version. void IgnoreButton(EventType, int) Remove interest in a particular type of button event for a specific button. This function is provided solely for backward compati- bility and will be removed in a future version. SEE ALSO
Event(3I) InterViews Reference Manual Sensor(3I)
All times are GMT -4. The time now is 08:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy