I need your help, because i know a local variable in a function for example k, it is different of other variable(with the same name k) this a global variable. Is that right?
the function "quita_ceros", I have it in include file:
if you see the debug, the value of variable global change after call the function "quita_ceros", why? both variable have the same name, but a is local variable and other is a variable global.
Thanks for advance.
Last edited by Scrutinizer; 12-29-2014 at 12:10 AM..
Reason: icode tags => code tags
I have encountered a very weird behavior of a global variable in Korn Shell in AIX:
A function f1 in my script pipes the output of the function f2 to a program.
A variable defined as global using typeset gets its value in f2.
That value is not seen in f1. If I remove the pipe ksh recognizes the... (2 Replies)
hi,
i need to add a new local variable to my script.
then i want to display its value along the title(with echo).
desired result:
password = x
Actual result:
x
for some reason the below line displays the x value.
password=cat config.xml |grep 'DB Password'|cut -f3 -d '='|cut -f2 -d... (1 Reply)
Im trying to parse ifconfig with awk and setup a bunch of variables in one shot. But Im having trouble figuring out how to work with data in previous lines.
ifconfig output:
eth0 Link encap:Ethernet HWaddr 00:50:DA:10:7F:1B
inet addr:10.10.10.10 Bcast:10.10.10.127 ... (0 Replies)
Hi,
I'm writing a korn shell script where the user enters a variable and I have to create a directory remotely which contains the name of that variable.
Example.
print 'Please enter variable:'
read variable
ssh user@host 'mkdir before_$variable;'
Thank you. (4 Replies)
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)
I've been working on improving my awk, and the next thing I want to learn is to properly use functions (I understand functions in shell and python). I have the following code which includes how I did this without functions before, and two attempts I've made to do it with functions:
function... (3 Replies)
Hi,
gtkdialog gui seperate buttons use seperate functions in their GUI. A variable (newFolderName) is being set in one function (funcA) and it needs to be called in another function (funcB). I thought using global variable (like in python) concept should work however it does not.
... (4 Replies)
I have a question on how can I assign a output of a function to a variable which is executed in background.
Here is my example
$ cat sample_program.sh
#!/bin/ksh
exec_func () {
sleep 1
v=`expr $1 + 100`
print $v
}
export OUT_ARR
date
for i in 1 2
do
OUT_ARR=`exec_func $i` &... (1 Reply)
I have a functions file containing functions:
file.functions:
myTest () {
echo "MYPWD=$(echo $(pwd))"
echo "MYLOGNAME=${LOGNAME}"
}
myCar () {
echo "MYDATE=$(date)"
echo "MYUPTIME=$(uptime)"
}
i know i can source this file in another script using something similar to this:
source... (8 Replies)
so i found a way to do this.
#!/bin/bash
MYF=$(/home/jason/myfunctions)
source <(printf '%s\n' "${MYF}")
echo "${var1}"
/home/jason/myfunctions is a script that outputs information..i.e. functions...etc that needs to be sourced. I have no control over /home/jason/myfunctions. i can... (3 Replies)
Discussion started by: SkySmart
3 Replies
LEARN ABOUT DEBIAN
minput_get_variable
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)