Sponsored Content
Full Discussion: Scope of exported function
Top Forums Shell Programming and Scripting Scope of exported function Post 302496514 by cfajohnson on Monday 14th of February 2011 09:14:34 AM
Old 02-14-2011

Check the users' group:
Code:
if [ $(id -g) = 666 ] ## adjust to taste
then
  . groupfuncs
fi

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

$0 scope in function and calling script

Hi folks, I'm just running through an oreilly korn shell book but have witnessed an output difference on my own unix machine and the output provided in the book. Can anyone help? create a script called ascript as follows: function afunc { print in function $0: $1 $2 var1="in... (16 Replies)
Discussion started by: beckett
16 Replies

2. Linux

Can USB Devices Be Exported Over a Network?

While I know that it's possible to use something like SANE to share a USB scanner over a network, or use NBD or iSCSI to share a USB flash or external HD over the network, I've been wondering about a raw USB <--> TCP/IP transport. Back in the late 90s, I swear I remember hearing about a project... (2 Replies)
Discussion started by: deckard
2 Replies

3. Solaris

Remove the exported zpool

I had a pool which was exported and due to some issues on my SAN i was never able to import it again. Can anyone tell me how can i destroy the exported pool to free up the LUN. I tried to create a new pool on the same pool but it gives me following error # zpool create emcpool4 emcpower0c... (0 Replies)
Discussion started by: fugitive
0 Replies

4. Shell Programming and Scripting

Seeing variable which are exported with export

Greeting to all of you! I've small issue related to the variable which we are setting and exporting through scripts, in one of the script there are some variable used but I am not abel to get the detail as where they are set. I tried finding the detail with the help of env but no luck. ... (2 Replies)
Discussion started by: kumarmani
2 Replies

5. Shell Programming and Scripting

using the exported variable after su

Dear All,How can use a variable which I have exported when I am logged into one user to be used once I su to another user.something like 1.Login to Unix box as user12. export var1="TEST"3. su - user24. User the var1 value ( it should return TEST)I have checked just export does not work. any other... (1 Reply)
Discussion started by: rahulkav
1 Replies

6. AIX

exported filesystems on a NIM server

I have a filesystem that was exported sometime in the past, probably by NIM processes, but cannot be unexported now. How can I get rid of this? Any ideas? I tried rebooting and it survived it. hostname:/:$ exportfs -v /usr/lpp/bos.sysmgt/nim/methods... (2 Replies)
Discussion started by: kah00na
2 Replies

7. Shell Programming and Scripting

Use of exported variable

i have to use the exported variable from one script into another script ex : A.ksh # !/bin/ksh chk1=56 export chk1 B.ksh # !/bin/ksh echo $chk1 i have executed the... (6 Replies)
Discussion started by: urfrnddpk
6 Replies

8. Shell Programming and Scripting

BASH: variable and function scope and subscripts

Hi, I'm a Delphi developer new to linux, new to this forums and new to BASH programming and got a new task in my work: maintaining an existing set of BASH scripts. First thing I want to do is making the code more reliable as in my opinion it's really bad written. So here's the quest: I'm... (6 Replies)
Discussion started by: rse
6 Replies

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

10. UNIX for Beginners Questions & Answers

Loading associative array from exported function

Hello. I have an export of an associative array build using declare -p SOME_ARRAY_NAME > SOME_FILE_NAME.txt. Producing some thing like declare -A SOME_ARRAY_NAME=( ="some_text" ="a_text" ......... ="another_text" ) in a text file. I have a stock of functions which are sourced from... (1 Reply)
Discussion started by: jcdole
1 Replies
JE::Scope(3pm)						User Contributed Perl Documentation					    JE::Scope(3pm)

NAME
JE::Scope - JavaScript scope chain (what makes closures work) DESCRIPTION
JavaScript code runs within an execution context which has a scope chain associated with it. This class implements this scope chain. When a variable is accessed the objects in the scope chain are searched till the variable is found. A JE::Scope object can also be used as global (JE) object. Any methods it does not understand will be delegated to the object at the bottom of the stack (the far end of the chain), so that "$scope->null" means the same thing as "$scope->[0]->null". Objects of this class consist of a reference to an array, the elements of which are the objects in the chain (the first element being the global object). (Think of it as a stack.) METHODS
find_var($name, $value) find_var($name) This method searches through the scope chain, starting at the end of the array, until it finds the variable named by the first argument. If the second argument is present, it sets the variable. It then returns an lvalue (a JE::LValue object) that references the variable. new_var($name, $value) new_var($name) This method creates (and optionally sets the value of) a new variable in the variable object (the same thing that JavaScript's "var" keyword does) and returns an lvalue. The variable object is the first object in the scope chain (searching from the top of the stack) that is a call object, or "$scope->[0]" if no call object is found. CONSTRUCTOR
None. Just bless an array reference. You should not need to do this because it is done for you by the "JE" and "JE::Object::Function" classes. SEE ALSO
JE JE::LValue JE::Object::Function perl v5.14.2 2012-03-18 JE::Scope(3pm)
All times are GMT -4. The time now is 09:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy