Sponsored Content
Top Forums Shell Programming and Scripting how to access globals in a function Post 302135829 by bluemoon1 on Wednesday 12th of September 2007 10:25:38 PM
Old 09-12-2007
Thank you for all the ideas- there are so many ways to solve a problem- if you know how;-) So ideas are always appreciated!
For this paticular script2 in conncern, I'm trying to do it differently- so that it doesn't have to update/access the variables in the calling scripts, and can be called directly (without sourcing) like this:
.....
doSomething parm1 parm2 parm3 .... #(passing some of the globals by adding more parameters)

We know this works;-)

Thank you again. I'm definitely learning from you:-)
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need help to access/mount so to access folder/files on a Remote System using Linux OS

Hi I need to access files from a specific folder of a Linux system from an another Linux System Remotely. I know how to, Export a folder on One SCO System & can access the same by using Import via., NFS in the Sco Unix SVR4 System using the scoadmin utility. Also, I know to use mount -t ... (2 Replies)
Discussion started by: S.Vishwanath
2 Replies

2. Shell Programming and Scripting

perl: globals and a package.

I am still learning perl and confused on this script I am revising at work. The original author uses a package, which I have left in the code; however, I cannot seem to access the global variable $dir. Code snippet: I have also tried using $RRD_MG::dir to no avail. Thank you. (6 Replies)
Discussion started by: effigy
6 Replies

3. UNIX for Dummies Questions & Answers

kernel giving access for multiple users to access files

hi all, i want to know y kernel is giving access for multiple users to access a file when one user may be the owner is executing that file. Because other user can manipulate that file when the other user is executing that file, it will give the unexpected result to owner . plz help me... (1 Reply)
Discussion started by: jimmyuk
1 Replies

4. Programming

How to access argv[x] from another function other than main???

Hi friends, when I am passing arguments to main, I want another function to be able to have access to that function, the problem is that I am creating athread, which has a function like void *xyz(void *), how can pass the refernce of argv to this function, if you see my program, you will better... (2 Replies)
Discussion started by: gabam
2 Replies

5. Programming

How access a specific memory portion through printf() function????

Hi friends, Hope everyone is doing well. Please have a look at this simple program, you will figure out what I want. #include <stdio.h> int main() { printf("Enter an integer!\n"); scanf( "%d", 134511890 ); // Valid address on my computer printf( "%d\n", ???? ); return 0; } ... (3 Replies)
Discussion started by: gabam
3 Replies

6. Solaris

samba read write access to owner and no access to other users

Hi All, I want to configure samba share permission so that only directory creator/owner has a read and write permission and other users should not have any read/write access to that folder.Will that be possible and how can this be achieved within samba configuration. Regards, Sahil (1 Reply)
Discussion started by: sahil_shine
1 Replies

7. Shell Programming and Scripting

Php server globals REQUEST_URI or HTTP_SERVER_VARS

Hi all, recently I found that $_SERVER does not deliver the complete url with query anymore on my server. http://www.example.org/search.php?stichwort=wiki echo $_SERVER; /search.phpHowever $GLOBALS works in this case. http://www.example.org/search.php?stichwort=wiki echo $GLOBALS;... (1 Reply)
Discussion started by: lowmaster
1 Replies

8. Proxy Server

How to use Squid on Linux to control certain IP to access Web Server and certain IP cannot access?

Dear all experts here, :) I would like to install a proxy server on Linux server to perform solely to control the access of Web server. In this case, some of my vendor asked me to try Squid and I have installed it onto my Linux server. I would like know how can I set the configuration to... (1 Reply)
Discussion started by: kwliew999
1 Replies

9. Programming

How to access a C function from a shell script?

Hi, I'm new to shell programming. And I'm having issues with accessing a C file with shell. Given a C code which contains functions and Lets say each function contains a multiplication instruction. So I need to extract the size of the operands (a,b) of each multiplication instruction in bits. How... (3 Replies)
Discussion started by: beginner_99
3 Replies

10. UNIX for Beginners Questions & Answers

Sudo has no access to exported bash function

Hello. I am running leap 15.1 sudo behavior may differ from other distrib. I have a file with functions definition .... function_1 { echo "Hello world" } export -f function_1 This file is sourced by both /etc/bash.bashrc.local and profile.local. So the functions are... (3 Replies)
Discussion started by: jcdole
3 Replies
DWARF_GET_GLOBALS(3)					   BSD Library Functions Manual 				      DWARF_GET_GLOBALS(3)

NAME
dwarf_get_globals, dwarf_global_cu_offset, dwarf_global_die_offset, dwarf_global_name_offsets, dwarf_globname -- retrieve information about global objects LIBRARY
DWARF Access Library (libdwarf, -ldwarf) SYNOPSIS
#include <libdwarf.h> int dwarf_get_globals(Dwarf_Debug dbg, Dwarf_Global **globals, Dwarf_Signed *nglobals, Dwarf_Error *err); int dwarf_global_cu_offset(Dwarf_Global global, Dwarf_Off *cu_offset, Dwarf_Error *err); int dwarf_global_die_offset(Dwarf_Global global, Dwarf_Off *die_offset, Dwarf_Error *err); int dwarf_global_name_offsets(Dwarf_Global global, char **name, Dwarf_Off *die_offset, Dwarf_Off *cu_die_offset, Dwarf_Error *err); int dwarf_globname(Dwarf_Global global, char **name, Dwarf_Error *err); DESCRIPTION
These functions retrieve information about global symbols from the lookup tables in the ``.debug_pubnames'' DWARF section. Information about these global symbols is returned using opaque descriptors of type Dwarf_Global. Applications need to use the functions described below to retrieve the name and the offsets for these descriptors. Function dwarf_get_globals() retrieves descriptors for all the global symbols associated with the DWARF debug context specified by argument dbg. The argument globals should point to a location that will be set to a pointer to an array of Dwarf_Global descriptors. The argument nglobals should point to a location that will be set to the number of descriptors returned. Function dwarf_global_cu_offset() returns the section-relative offset, relative to the ``.debug_info'' section, of the compilation unit that contains the debugging information entry associated with the argument global. Argument cu_offset should point to a location that will hold the returned offset. Function dwarf_global_die_offset() retrieves the section-relative offset, relative to the ``.debug_info'' section, of the debugging informa- tion entry associated with the argument global, and stores it into the location pointed to by the argument die_offset. Function dwarf_global_name_offsets() retrieves the name and the offsets for the debugging information entry for argument global. Argument name should point to a location which will be set to a pointer to a NUL-terminated string containing the name of the associated debugging information entry. Argument die_offset should point to a location which will be set to a section-relative offset, relative to the ``.debug_info'' section, of the associated debugging information entry. Argument cu_die_offset should point to a location which will be set to a section-relative offset, relative to the ``.debug_info'' section, of the first debugging information entry in the compilation unit asso- ciated with argument global. Function dwarf_globname() sets the location pointed to by argument name to a pointer to a NUL-terminated string holding the name of the debugging information entry associated with the argument global. Memory Management The memory area used for the array of Dwarf_Global descriptors returned in argument globals by function dwarf_get_globals() is owned by the DWARF Access Library (libdwarf, -ldwarf). Application code should not attempt to directly free this pointer. Portable code should instead use the function dwarf_globals_dealloc(3) to indicate that the memory area may be freed. The memory area used for the string returned in the name argument to functions dwarf_globname() and dwarf_global_name_offsets() is owned by the DWARF Access Library (libdwarf, -ldwarf). Portable code should use the dwarf_dealloc(3) function to indicate that the memory area may be freed. Error Returns If argument err is not NULL, these functions will use it to store error information, in case of an error. 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] One of the arguments cu_die_offset, cu_offset, dbg, die_offset, global, globals, name, or nglobals was NULL. SEE ALSO
dwarf(3), dwarf_dealloc(3), dwarf_get_cu_die_offset_given_cu_header_offset(3), dwarf_globals_dealloc(3) BSD
April 2, 2011 BSD
All times are GMT -4. The time now is 04:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy