Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

global(n) [opendarwin man page]

global(n)						       Tcl Built-In Commands							 global(n)


global - Access global variables SYNOPSIS
global varname ?varname ...? _________________________________________________________________ DESCRIPTION
This command is ignored unless a Tcl procedure is being interpreted. If so then it declares the given varname's to be global variables rather than local ones. Global variables are variables in the global namespace. For the duration of the current procedure (and only while executing in the current procedure), any reference to any of the varnames will refer to the global variable by the same name. SEE ALSO
namespace(n), upvar(n), variable(n) KEYWORDS
global, namespace, procedure, variable Tcl global(n)

Check Out this Related Man Page

global(n)						       Tcl Built-In Commands							 global(n)


global - Access global variables SYNOPSIS
global varname ?varname ...? _________________________________________________________________ DESCRIPTION
This command has no effect unless executed in the context of a proc body. If the global command is executed in the context of a proc body, it creates local variables linked to the corresponding global variables (though these linked variables, like those created by upvar, are not included in the list returned by info locals). If varname contains namespace qualifiers, the local variable's name is the unqualified name of the global variable, as determined by the namespace tail command. varname is always treated as the name of a variable, not an array element. An error is returned if the name looks like an array element, such as a(b). EXAMPLES
This procedure sets the namespace variable ::a::x proc reset {} { global a::x set x 0 } This procedure accumulates the strings passed to it in a global buffer, separated by newlines. It is useful for situations when you want to build a message piece-by-piece (as if with puts) but send that full message in a single piece (e.g. over a connection opened with socket or as part of a counted HTTP response). proc accum {string} { global accumulator append accumulator $string } SEE ALSO
namespace(n), upvar(n), variable(n) KEYWORDS
global, namespace, procedure, variable Tcl global(n)
Man Page

14 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK -> getting "global" vars

Hello, presently, I'm calling nawk from my main script and have nawk defined in one file. So I call nawk like this nawk -f file input This file defines how to separate mails in /var/mail/$user and show 1 at a time. However, I would also like to do other actions (delete message, forward... (9 Replies)
Discussion started by: petoSVK
9 Replies

2. Shell Programming and Scripting

how to access globals in a function

I know any globals can be directly modified in a function without passing/returning parameters- provided the function is written within the same file. However, when I wrote functions in a saparate file (so hopefully they can be re-used by multiple script programs), and then call them from the main,... (11 Replies)
Discussion started by: bluemoon1
11 Replies

3. UNIX for Advanced & Expert Users

global substitution in VI

Hi All, I'm trying to add a carriage return to the end of my lines in a text file using substitution, but I havent found a way as yet. Can anyone help? something along the lines of: :%s/<^A/^M/g obviously, this doesnt work. Many thanks. (11 Replies)
Discussion started by: OLweiser
11 Replies

4. Shell Programming and Scripting

global date for many scripts in shell

Hi, I am using shell (#!/bin/bash), i am trying to set my date in a script, i want this dates to be used by another scripts. I have tried to make: #!/bin/bash begin_date =`date +%Y_%m_%d_%H_%M_%S`, i also tried: #!/bin/bash begin_date =20080709 12:14:11, then i write in... (11 Replies)
Discussion started by: rosalinda
11 Replies

5. Solaris

How to know the global zonename from non-global zone?

It is easy to list all zones from global zones, but how to find out the global zone name from non-global zone? thx (11 Replies)
Discussion started by: honglus
11 Replies

6. Solaris

Not able to ping global zone from local zone

Hi Gurus I am not able to ping the local zone from global zone when i am trying to ping i am getting below ICMP Host Unreachable from gateway zone ( for icmp from zone ( to sun1 ( However i can ping local zone from global please... (12 Replies)
Discussion started by: kumarmani
12 Replies

7. Solaris

Non-Global zone take high CPU utilization.

In Production system there is 12 Non-Global Zones. So in that 12 Non-Global zones one of the Non-Global zone taking 60-70% CPU usage and load average become very high. Running processors are 52 only. Please advise me is there any way to reduce the CPU sharing Utilization. (Most Urgent) ... (9 Replies)
Discussion started by: murthy76
9 Replies

8. Solaris

DHCP Server in Non-Global Zone

I am having trouble starting the DCHP server in a non-global zone that has exclusive access to an interface. Every time I attempt to start it goes in to maintenance mode and the error in the log shows this: I have seen on a thread on Sun's forums that addressed this but it was dealing with Solaris... (9 Replies)
Discussion started by: Lespaul20
9 Replies

9. Shell Programming and Scripting

Sed command to globally replace xth occurance.

This should replace the 1st and the 3rd occurance of "the": sed -e "s/ the / those /1;s/ the / these /3" This works only by line. If there is a second "the", but in an other line for example, it counts it as 1st again and replaces it again. How can I replace "the" 1st and 3rd... (14 Replies)
Discussion started by: lowmaster
14 Replies

10. Solaris

Adding multiple virtual interfaces on a non global zone.

Hello All, I have a requirement to add multiple virtual interfaces on a non-global zone (Solaris 10). The global zone is a 2 node Veritas Cluster Server. So, my question is do we have to make any modifications to the cluster config (which I think should not be the case)? Can anyone help with me... (11 Replies)
Discussion started by: mahive
11 Replies

11. Solaris

How to identify a global or non-global Solaris server?

Hi, I have Solaris zone configured with Solaris 9 and 10. In Solaris 10(non global), I use the command “zonename” to get whether it is global or non-global server. For Solaris 9, what command I can use to get whether it is global or non-global server. Regards, Kalai :confused: (25 Replies)
Discussion started by: kalpeer
25 Replies

12. UNIX for Dummies Questions & Answers

Is there any global command in UNIX?

Hi, I heard about some global commands for information gathering in UNIX systems. some commands which will execute on a UNIX system in a local network and other systems will reply to these command with some information about themselves. for example, from one of those UNIX machines (in a... (15 Replies)
Discussion started by: siavash
15 Replies

13. Solaris

Modify the Hostid in a Solaris 11 Global Zone running on VMWare

Hi Folks, I've been presented with an unexpected problem and I'm not sure if I can resolve it without some input from people. I have on this site 3 license servers running Solaris, one at; SunOS xxxxxx 5.8 Generic_117350-08 sun4u sparc SUNW,Ultra-5_10 One at; SunOS yyyyyy 5.7... (12 Replies)
Discussion started by: gull04
12 Replies

14. Solaris

Solaris Global/Zones patching

Issue is : We have Solaris Global with 12 Zones and some have 15 Zones. All the OS version are10. Is it possible to apply patch at Zone level instead of patching at Global level? Please let me know. (10 Replies)
Discussion started by: baladelaware73
10 Replies

Featured Tech Videos