Sponsored Content
Full Discussion: Accessing local variable
Top Forums Shell Programming and Scripting Accessing local variable Post 302529280 by IND123 on Thursday 9th of June 2011 02:19:55 AM
Old 06-09-2011
Accessing local variable

Hi,

Would like to know the purpose and accessing of local variable as in below code snippet:

HTML Code:
a=123
( a=321; )	      

echo "a = $a"   #This will print 123
How to access local a variable which is assigned with value 321 ?. ..



 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Accessing remote machine via an enviroment variable

Hi. Is it possible to remotely access another unix box via an enviroment variable, on another machine? I am trying to create an environment variable $MIPSDATA which will point to a folder on another machine. I have setup the .rhosts file and got that working on both machines (tested via a... (4 Replies)
Discussion started by: ElCaito
4 Replies

2. Shell Programming and Scripting

Accessing invidual characters in a variable name

hi, How do i access individual characters in a string variable value . say i have var=20060731. How do i retrieve 2,0,0,6 etc chars separately. Is there any Field separator in cut or awk to achieve the same? Regards, Suman (2 Replies)
Discussion started by: suman_jakkula
2 Replies

3. UNIX for Dummies Questions & Answers

Accessing Global Env Variable

Greetings: I need to remove 'RUBYOPT' env variable to install MacRuby. I see it via $env (tchrc). I checked my (local) .tcshrc, .login, .profile files: not defined there. Apparently, it's not set locally. I know this RUBYOPT is global, since I can see it in another account on my... (4 Replies)
Discussion started by: UncleRic
4 Replies

4. Shell Programming and Scripting

Accessing a variable from another script

Hi, Can anyone assist me on how to access a variable in a shell script from another script. for ex, Script-1 ------- #! /bin/sh c=10 Where as, i would like to access the velue of variable c in another script 'Script-2'. Thankyou to all in advance !! :b: :b: (2 Replies)
Discussion started by: little_wonder
2 Replies

5. Shell Programming and Scripting

Accessing the variable from pl sql bolck

I hve a PL SQL block in unix where i define a variable "var_px_cat" and use it for taking count SELECT COUNT(*) INTO var_px_cat FROM A WHERE B = '$CATEGORIE_ID'; Now how do I access the variable "var_px_cat" in unix after exiting from pl sql block. (3 Replies)
Discussion started by: theeights
3 Replies

6. Shell Programming and Scripting

accessing a variable or array of one script in another

hi all, i've a requirement like this. i want to access the contents of an array declared in one script,which is a bash script, to a second script which is a perl script. actually i want a sort of global variable which can be accessed in other script like environmen variables and also i can... (3 Replies)
Discussion started by: tprayush
3 Replies

7. Shell Programming and Scripting

Accessing a variable from another file

HI all, How can i access a variable that is defined in another file as: $$Name= "abhinav; in my script. The catch is that it has 2 $s behind it... Thnaks ---------- Post updated at 10:36 AM ---------- Previous update was at 10:29 AM ---------- the file from which i have to... (0 Replies)
Discussion started by: abhinav192
0 Replies

8. Shell Programming and Scripting

Help with awk and accessing variable values within the syntax

I'm writing a bash script, and I am having trouble with this line: awk '{print "url = \"http://www.example.com/directory/$type/"$1"\""}' input.file > output.file Within the URL being printed, I wish the value of the variable "$type" to be printed, after being read from user input from the... (2 Replies)
Discussion started by: meridionaljet
2 Replies

9. Shell Programming and Scripting

accessing variable from while loop

Hi all, Here is an outline of the problem: #variable declared at start of script x=0; #a function that increments x by 1 every 10 seconds incrementX(){ increments x every 10 seconds; } #i want this to output the value of x every second. The problem is that x is always reported... (3 Replies)
Discussion started by: free2rhyme2k
3 Replies

10. Shell Programming and Scripting

Significance of ':-' while accessing a variable

Hi I was trying to understand what ':-' means when used with variables echo ${x:-10} if Thanks (4 Replies)
Discussion started by: zulfi123786
4 Replies
NETINFO(5)							AFS File Reference							NETINFO(5)

NAME
NetInfo - Defines machine interfaces to register with AFS servers DESCRIPTION
There are two NetInfo files, one for an AFS client and one for an AFS File Server or database server. The AFS client NetInfo file specifies the IP addresses that the client should register with the File Servers it connects to. The server NetInfo file specifies what interfaces should be registered with AFS Database Servers or used to talk to other database servers. Client NetInfo The client NetInfo file lists the IP addresses of one or more of the local machine's network interfaces. If it exists in the /etc/openafs directory when the Cache Manager initializes, the Cache Manager uses its contents as the basis for a list of local interfaces. Otherwise, the Cache Manager uses the list of interfaces configured with the operating system. It then removes from the list any addresses that appear in the /etc/openafs/NetRestrict file, if it exists. The Cache Manager records the resulting list in kernel memory. The first time it establishes a connection to a File Server, it registers the list with the File Server. The File Server uses the addresses when it initiates a remote procedure call (RPC) to the Cache Manager (as opposed to responding to an RPC sent by the Cache Manager). There are two common circumstances in which the File Server initiates RPCs: when it breaks callbacks and when it pings the client machine to verify that the Cache Manager is still accessible. The NetInfo file is in ASCII format. One of the machine's IP addresses appears on each line, in dotted decimal format. The File Server initially uses the address that appears first in the list. The order of the remaining addresses is not significant: if an RPC to the first interface fails, the File Server simultaneously sends RPCs to all of the other interfaces in the list. Whichever interface replies first is the one to which the File Server then sends pings and RPCs to break callbacks. To prohibit the Cache Manager absolutely from using one or more addresses, list them in the NetRestrict file. To display the addresses the Cache Manager is currently registering with File Servers, use the fs getclientaddrs command. To replace the current list of interfaces with a new one between reboots of the client machine, use the fs setclientaddrs command. Server NetInfo The server NetInfo file, if present in the /var/lib/openafs/local directory, defines the following: o On a file server machine, the local interfaces that the File Server (fileserver process) can register in the Volume Location Database (VLDB) at initialization time. o On a database server machine, the local interfaces that the Ubik database synchronization library uses when communicating with the database server processes running on other database server machines. If the NetInfo file exists when the File Server initializes, the File Server uses its contents as the basis for a list of interfaces to register in the VLDB. Otherwise, it uses the list of network interfaces configured with the operating system. It then removes from the list any addresses that appear in the /var/lib/openafs/local/NetRestrict file, if it exists. The File Server records the resulting list in the /var/lib/openafs/local/sysid file and registers the interfaces in the VLDB. The database server processes use a similar procedure when initializing, to determine which interfaces to use for communication with the peer processes on other database machines in the cell. The NetInfo file is in ASCII format. One of the machine's IP addresses appears on each line, in dotted decimal format. The order of the addresses is not significant. Optionally, the File Server can be forced to use an IP address that does not belong to one of the server interfaces. To do this, add a line to the NetInfo file with the IP address prefixed with "f" and a space. This is useful when the File Server is on the internal side of a NAT firewall. To display the File Server interface addresses registered in the VLDB, use the vos listaddrs command. EXAMPLES
If the File Server is on the internal side of a NAT firewall, where it serves internal clients using the IP address 192.168.1.123 and external clients using the IP address 10.1.1.321, then the NetInfo file should contain the following: 192.168.1.123 f 10.1.1.321 SEE ALSO
NetRestrict(5), sysid(5), vldb.DB0(5), fileserver(8), fs_getclientaddrs(1), fs_setclientaddrs(1), vos_listaddrs(1) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 NETINFO(5)
All times are GMT -4. The time now is 02:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy