Sponsored Content
Top Forums Shell Programming and Scripting Passing global variable to a function which is called by another function Post 302107523 by sars on Monday 19th of February 2007 12:22:48 AM
Old 02-19-2007
Passing global variable to a function which is called by another function

Hi ,

I have three funcions f1, f2 and f3 .
f1 calls f2 and f2 calls f3 .
I have a global variable "period" which i want to pass to f3 .
Can i pass the variable directly in the definition of f3 ?
Pls help .

sars
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing a variable name to be created within a function

Is it possible to pass a variable name, as a parameter to a function, so it can be created within this function ? Something like this: func_uppercase abcdefgh var_name where the 1st parameter is the string I want to convert and the 2nd is the desired variable name... $2=`echo "$1" |... (2 Replies)
Discussion started by: 435 Gavea
2 Replies

2. UNIX for Dummies Questions & Answers

passing variable to function

Hi, I am trying to sum up numbered columns and in order to tidy up the program I have wrote a function to do the adding of some numbers. I have a problem though with passing a variable to the function in the UNIX bash shell. The function only gives the first number in the variable list and does... (4 Replies)
Discussion started by: Knotty
4 Replies

3. UNIX for Advanced & Expert Users

Passing a unix variable value to a Plsql function

Suppose I have a unix variable called RGNM which is holding a value. Now I want to call a plsql function in my script. THis plsql function takes one IN parameter. I want to pass my UNIX VARIABLE Value to the plsql function. Can i just give it by giving $RGNM in the function after calling sqlplus... (1 Reply)
Discussion started by: cobroraj
1 Replies

4. UNIX for Dummies Questions & Answers

passing a variable inside a variable to a function

I would like to know how to pass a variable inside a variable to a function. sample code below -------------- for x in 1 9 do check_null $C$x ##call function to check if the value is null if then echo "line number:$var_cnt,... (2 Replies)
Discussion started by: KingVikram
2 Replies

5. Shell Programming and Scripting

Return a value from called function to the calling function

I have two scripts. script1.sh looks -------------------------------- #!/bin/bash display() { echo "Welcome to Unix" } display ----------------------------- Script2.sh #!/bin/bash sh script1.sh //simply calling script1.sh ------------------------------ (1 Reply)
Discussion started by: mvictorvijayan
1 Replies

6. Shell Programming and Scripting

passing variable content to a function

following on from below link https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569 i will be using file reading in while loop say for example while read line123 do echo "line read is $line123" insert_funct $line123 done< mysqldump.sql... (6 Replies)
Discussion started by: vivek d r
6 Replies

7. Shell Programming and Scripting

Error during Accessing Global variable inside function

emailid=myemail@xyz.com taskName="DB-Backup" starttime=`date` email() { subject="$taskName" ": " $* " at `date` " mutt -s "$subject" $emailid < /dev/null } email "Starting" #do my stuff email "Finished" The above code gives following error ./dbbackup.sh: line 6: :... (5 Replies)
Discussion started by: nitiraj.rathore
5 Replies

8. Shell Programming and Scripting

Passing variable value in a function to be used by another function

Hello All, I would like to ask help from you on how to pass variable value from a function that has been called inside the function. I have created below and put the variables in " ". Is there another way I can do this? Thank you in advance. readtasklist() { while read -r mod ver... (1 Reply)
Discussion started by: aderamos12
1 Replies

9. Shell Programming and Scripting

Function getting called recursively

I have the below script which creates a directory or simply terminates without throwing error (exit 1) incase the directory exists. bash-4.1$ vi mdir.sh #!/bin/bash -e shopt -s expand_aliases alias mkdir=mkdir_s mkdir_s(){ if ]; then echo " directory EXISTS " return else echo "... (3 Replies)
Discussion started by: mohtashims
3 Replies

10. Shell Programming and Scripting

Shell script to pass the config file lines as variable on the respective called function on a script

I want to make a config file which contain all the paths. i want to read the config file line by line and pass as an argument on my below function. Replace all the path with reading config path line by line and pass in respective functions. how can i achieve that? Kindly guide. ... (6 Replies)
Discussion started by: sadique.manzar
6 Replies
minput_get_variable(3m17n)					 The m17n Library					minput_get_variable(3m17n)

NAME
minput_get_variable - Get information about input method variable(s). SYNOPSIS
MPlist* minput_get_variable (MSymbol language, MSymbol name, MSymbol variable) DESCRIPTION
Get information about input method variable(s). The minput_get_variable() function returns information about variable variable of the input method specified by language and name. An input method variable controls behavior of an input method. There are two kinds of variables, global and local. A global variable has a global definition, and the description and the value may be inherited by a local variable. Each input method defines a local variable which has local value. It may also declare a local variable that inherits definition of a global variable of the same name. If language is Mt and name is Mnil, information about a global variable is returned. Otherwise information about a local variable is returned. If variable is Mnil, information about all variables is returned. The return value is a well-formed plist (Property List) of this format: ((NAME DESCRIPTION STATUS VALUE [VALID-VALUE ...]) ...) NAME is a symbol representing the variable name. DESCRIPTION is an M-text describing the variable, or Mnil if the variable has no description. STATUS is a symbol representing how the value is decided. The value is Mnil (the default value), Mcustomized (the value is customized by per-user customization file), or Mconfigured (the value is set by the call of minput_config_variable()). For a local variable only, it may also be Minherited (the value is inherited from the corresponding global variable). VALUE is the initial value of the variable. If the key of this element is Mt, the variable has no initial value. Otherwise, the key is Minteger, Msymbol, or Mtext and the value is of the corresponding type. VALID-VALUEs (if any) specify which values the variable can have. They have the same type (i.e. having the same key) as VALUE except for the case that VALUE is an integer. In that case, VALID-VALUE may be a plist of two integers specifying the range of possible values. If there no VALID-VALUE, the variable can have any value as long as the type is the same as VALUE. If variable is not Mnil, the first element of the returned plist contains the information about variable. RETURN VALUE
If the requested information was found, a pointer to a non-empty plist is returned. As the plist is kept in the library, the caller must not modify nor free it. Otherwise (the specified input method or the specified variable does not exist), NULL is returned. COPYRIGHT
Copyright (C) 2001 Information-technology Promotion Agency (IPA) Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST) Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License <http://www.gnu.org/licenses/fdl.html>. Version 1.6.2 12 Jan 2011 minput_get_variable(3m17n)
All times are GMT -4. The time now is 02:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy