Accessing a variable from another file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Accessing a variable from another file
# 1  
Old 11-23-2009
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 access the variable is a .prm file
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

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

3. Shell Programming and Scripting

Accessing local variable

Hi, Would like to know the purpose and accessing of local variable as in below code snippet: a=123 ( a=321; ) echo "a = $a" #This will print 123 How to access local a variable which is assigned with value 321 ?. .. (3 Replies)
Discussion started by: IND123
3 Replies

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

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

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

7. Programming

Accessing environmet variable in xml file

Hi I have certain environmenet variables defined in .profile: export DBNAME="mydb" export DBHOST="devbox.us.abc.com" export DBPORT="1111" export PASSWORD="mypwd" export MMUSER="myid" I also have an xml file defined like: <CONFIG> <DEFAULTS operator="oraread"> <PROPERTY... (2 Replies)
Discussion started by: neeto
2 Replies

8. Shell Programming and Scripting

Grep to return a code from accessing variable file name

All I want to do is find out if the string 'NO' is in a file by checking for a return code of 0 if there is a match. The grep works fine on the command line directly naming the file but I am obviously not using the correct syntax within the shell script as I consistently get the error message ... (5 Replies)
Discussion started by: SusanDAC
5 Replies

9. UNIX for Dummies Questions & Answers

accessing shell script variable in file

Hi, I have a shell script in which there is a file conn_$temp where $temp has the pid of the shell script. in this shell script i have an embedded awk script that must read the file while ((getline < "conn_$temp") > 0) However due to the "$temp" in the file name, the awk script is... (6 Replies)
Discussion started by: HIMANI
6 Replies

10. 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
Login or Register to Ask a Question
catch(n)						       Tcl Built-In Commands							  catch(n)

__________________________________________________________________________________________________________________________________________________

NAME
catch - Evaluate script and trap exceptional returns SYNOPSIS
catch script ?resultVarName? ?optionsVarName? _________________________________________________________________ DESCRIPTION
The catch command may be used to prevent errors from aborting command interpretation. The catch command calls the Tcl interpreter recur- sively to execute script, and always returns without raising an error, regardless of any errors that might occur while executing script. If script raises an error, catch will return a non-zero integer value corresponding to the exceptional return code returned by evaluation of script. Tcl defines the normal return code from script evaluation to be zero (0), or TCL_OK. Tcl also defines four exceptional return codes: 1 (TCL_ERROR), 2 (TCL_RETURN), 3 (TCL_BREAK), and 4 (TCL_CONTINUE). Errors during evaluation of a script are indicated by a return code of TCL_ERROR. The other exceptional return codes are returned by the return, break, and continue commands and in other special situa- tions as documented. Tcl packages can define new commands that return other integer values as return codes as well, and scripts that make use of the return -code command can also have return codes other than the five defined by Tcl. If the resultVarName argument is given, then the variable it names is set to the result of the script evaluation. When the return code from the script is 1 (TCL_ERROR), the value stored in resultVarName is an error message. When the return code from the script is 0 (TCL_OK), the value stored in resultVarName is the value returned from script. If the optionsVarName argument is given, then the variable it names is set to a dictionary of return options returned by evaluation of | script. Tcl specifies two entries that are always defined in the dictionary: -code and -level. When the return code from evaluation of | script is not TCL_RETURN, the value of the -level entry will be 0, and the value of the -code entry will be the same as the return code. | Only when the return code is TCL_RETURN will the values of the -level and -code entries be something else, as further described in the doc- | umentation for the return command. | When the return code from evaluation of script is TCL_ERROR, three additional entries are defined in the dictionary of return options | stored in optionsVarName: -errorinfo, -errorcode, and -errorline. The value of the -errorinfo entry is a formatted stack trace containing | more information about the context in which the error happened. The formatted stack trace is meant to be read by a person. The value of | the -errorcode entry is additional information about the error stored as a list. The -errorcode value is meant to be further processed by | programs, and may not be particularly readable by people. The value of the -errorline entry is an integer indicating which line of script | was being evaluated when the error occurred. The values of the -errorinfo and -errorcode entries of the most recent error are also avail- | able as values of the global variables ::errorInfo and ::errorCode respectively. | Tcl packages may provide commands that set other entries in the dictionary of return options, and the return command may be used by scripts | to set return options in addition to those defined above. EXAMPLES
The catch command may be used in an if to branch based on the success of a script. if { [catch {open $someFile w} fid] } { puts stderr "Could not open $someFile for writing $fid" exit 1 } There are more complex examples of catch usage in the documentation for the return command. SEE ALSO
break(n), continue(n), dict(n), error(n), return(n), tclvars(n) KEYWORDS
catch, error Tcl 8.5 catch(n)