Sponsored Content
Top Forums Shell Programming and Scripting error in shell script while returning values-- urgent issue plz help. Post 302584988 by ahamed101 on Tuesday 27th of December 2011 03:17:57 AM
Old 12-27-2011
How are you assigning the return value? One way is...

Code:
function foo
{
  a=10
  return $a
}

#Function call
foo
ret=$?

echo $ret

--ahamed
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Returning Values (shell Script)

I have an application on Informix 4GL, and I am invoking the shell script from the program, but I need to know if the shell script work fine or not, in order to continue the process. I know that we can use $? to get the final status but this is on unix command. How can I return a value from the... (3 Replies)
Discussion started by: jennifer01
3 Replies

2. UNIX for Dummies Questions & Answers

urgent plz

guys i have sun solaries 8 under intel .. i added a new D-LINK ethernet and i need to see if the computer define it or not .. so i need to make reconfiguraion .. what was the command ... for reconfiguration ??? thanks alot (3 Replies)
Discussion started by: tamemi
3 Replies

3. Shell Programming and Scripting

Returning values from child to parent shell

I need to send the status from child shell failure to parent shell. I would like to know how could we accomplish this. My parent.sh is as below: #!/bin/ksh set -x echo "I am in parent shell now..." child.sh ret_stat=$? echo "rest_stat=$ret_stat" echo "I am below parent shell end..." ... (4 Replies)
Discussion started by: acheepi
4 Replies

4. Shell Programming and Scripting

help in writing awk script, plz urgent

I have a file like this I have to I have input file this , I want to give the out put in the below input file (NARAYANA 1 ENDING AT (100, 16383) ,NARAYANA 2 ENDING AT (100, 32766) ,NARAYANA 3 ENDING AT (100, 49149) ,NARAYANA 4 ENDING AT (100, 65535) ,NARAYANA 5... (8 Replies)
Discussion started by: LAKSHMI NARAYAN
8 Replies

5. Shell Programming and Scripting

shell script returning error code 2 from AIX to Mainframe

Hi, I have a shell script which is residing on AIX which is triggered by Mainframe through Connect Direct. The shell script creates several files and sends those files to mainframe using Connect Direct. The shell script is working fine, still it is returning exit code 2 to mainframe. What... (0 Replies)
Discussion started by: Yogesh Aggarwal
0 Replies

6. AIX

Need help..Urgent plz

Hi All, For listing large files i am using the following command find /XYZ/ -xdev -size +100000 |xargs ls -l |sort -nr -k 5..And my question is i am getting more number of files with this, so not able to copy those, how can I get those all in page by page , so that I can able to copy those... (4 Replies)
Discussion started by: adminaix55
4 Replies

7. Shell Programming and Scripting

Returning to shell from previous script

Found myself stuck on this seemingly trivial issue. I have this script which call other shell files to do their deeds. The shell files in turn call some other programs as well. My problem is that in two of these shell files, the control doesnt return to next command in script unless the Enter key... (2 Replies)
Discussion started by: DoesntMatter
2 Replies

8. Shell Programming and Scripting

Returning multiple values in Shell

Hi I have a code as the following #!/usr/bin/ksh set -x row() { a=$1 b=$2 c=$(($a + $b)) d=$(($a * $b)) echo $a $b } e=`row 2 3` set $e echo "The value of c is $c" echo "The value of d is $d" My requirement is I need to pass two arguments to a function and return two values... (5 Replies)
Discussion started by: Priya Amaresh
5 Replies

9. Shell Programming and Scripting

Getting error while including values in xml tags using shell script

Hi All, Please find the code below where I want to add the variable value in between the XML tags. I am taking one string and my goal is to put them between the xml tags. Ex : in between <name> , <lname> Kindly suggest a correction because while executing this script I am getting and... (8 Replies)
Discussion started by: rajneesh4U
8 Replies

10. Shell Programming and Scripting

URGENT Reading a file and assessing the syntax shell script URGENT

I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies
DWARF_LINENO(3) 					   BSD Library Functions Manual 					   DWARF_LINENO(3)

NAME
dwarf_lineaddr, dwarf_linebeginstatement, dwarf_lineblock, dwarf_lineendsequence, dwarf_lineno, dwarf_lineoff, dwarf_linesrc, dwarf_line_srcfileno -- retrieve information associated with a DWARF line descriptor LIBRARY
DWARF Access Library (libdwarf, -ldwarf) SYNOPSIS
#include <libdwarf.h> int dwarf_lineaddr(Dwarf_Line ln, Dwarf_Addr *ret, Dwarf_Error *err); int dwarf_linebeginstatement(Dwarf_Line ln, Dwarf_Bool *ret, Dwarf_Error *err); int dwarf_lineblock(Dwarf_Line ln, Dwarf_Bool *ret, Dwarf_Error *err); int dwarf_lineendsequence(Dwarf_Line ln, Dwarf_Bool *ret, Dwarf_Error *err); int dwarf_lineno(Dwarf_Line ln, Dwarf_Unsigned *ret, Dwarf_Error *err); int dwarf_lineoff(Dwarf_Line ln, Dwarf_Signed *ret, Dwarf_Error *err); int dwarf_linesrc(Dwarf_Line ln, char **ret, Dwarf_Error *err); int dwarf_line_srcfileno(Dwarf_Line ln, Dwarf_Unsigned *ret, Dwarf_Error *err); DESCRIPTION
These functions retrieve specific line information associated with the line descriptor specified by argument ln, and stores it in the loca- tion pointed to by argument ret. If argument err is not NULL, it will be used to store error information in case of an error. Function dwarf_lineaddr() stores the program address corresponding to the source line specified in argument ln into the location pointed to by argument ret. Function dwarf_linebeginstatement() sets the location pointed to by argument ret to 1 if the source line specified by the line descriptor ln is the beginning of a statement, or to 0 otherwise. Function dwarf_lineblock() sets the location pointed to by argument ret to 1 if the source line specified by the line descriptor ln is the beginning of a basic block, or to 0 otherwise. Function dwarf_lineendsequence() sets the location pointed to by argument ret to 1 if the program address associated with the line descriptor ln is the address immediately following the end of a sequence of target machine instructions, or to 0 otherwise. Function dwarf_lineno() stores the line number of the source line associated with the line descriptor ln into the location pointed to by argument ret. Function dwarf_lineoff() stores the column number within a line associated with descriptor ln into the location pointed to by argument ret. The retrieved column numbers are 1-based, with the value -1 indicating that column number information was not available. Function dwarf_linesrc() stores a pointer to a NUL-terminated string containing the source file name associated with line descriptor ln into the location pointed to by argument ret. The full path of the source file is returned if possible. The memory used for the source file name string is managed by the DWARF(3) library and should not be directly freed by application code. Instead, portable code should use dwarf_dealloc(3) to indicate that the string should be freed. Function dwarf_line_srcfileno() stores the index of the source file associated with the line descriptor ln in the location pointed to by argument ret. The returned value is 1-based index into the array of source file names returned by dwarf_srcfiles(3). RETURN VALUES
On success, these functions returns DW_DLV_OK. In case of an error, they return DW_DLV_ERROR and set the argument err. ERRORS
These functions may fail with the following errors: [DW_DLE_ARGUMENT] Either of the arguments ln or ret was NULL. [DW_DLE_LINE_FILE_NUM_BAD] The source file name associated with the line descriptor ln could not be retrieved by function dwarf_linesrc(). SEE ALSO
dwarf(3), dwarf_dealloc(3), dwarf_srcfiles(3), dwarf_srclines(3) BSD
February 5, 2011 BSD
All times are GMT -4. The time now is 12:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy