You either can't or won't tell me what the purpose of your program is. Nobody writes a program to "substitute in a variable", presumably that program has some actual use to you.
Fine, I'll do what I can without it.
You are doing it exactly backwards, which is why you are having so many problems. Set the variables first. Then make your query, letting it substitute the variables right then and there. That is the way variables are supposed to work. You'll get exactly what you want, quotes intact.
If possible, use it directly instead of storing it in a variable -- 30 lines is a lot to put in one variable, and you want to avoid splitting and accidental substitution anyway. You can use a here-document to stream something into a program, variables will substitute inside it:
Last edited by Corona688; 08-09-2012 at 06:49 PM..
Hi
I have a variable which is a path ie:
UBERROR=/cobwrk/mchr/prodsup/ub/wrk/../error
is there anyway I can get the output of an echo to read:
#echo $UBERROR
/cobwrk/mchr/prodsup/ub/error
instead of
#echo $UBERROR
/cobwrk/mchr/prodsup/ub/wrk/../error
Many thanks! (2 Replies)
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)
Hi Gurus
I have a file called /tmp/CMDB which looks like this
serial: 0623AN1208
hostname: server1
model: x4100
assetID: 1234
I am writing a for loop that will go through this file line by line creating a variable of itself. Using the first iteration of the loop (i.e. the first line) as... (6 Replies)
Hi,
I am trying to do the following thing
var='date'
$var
Above command substitutes date for and in turn runs the date command and i am getting the todays date value.
I am trying to do the same thing as following, but facing some problems,
unique_host_pro="sed -e ' /#/d'... (3 Replies)
Hi there, i think im getting myself a little confused and need some help :wall:
I am reading in a bunch of variables to my script from an external file and need to validate that a value has been set for each
so if you can imagine, the user is required to pass in 4 values... (3 Replies)
I am tyring to resolve an environment variable that is part of a string I selected from our database.
Simply put, I want cd to this folder before checking if a file exists.
The variable $in_loc has the value '$PS_HOME/int/VSP' where $PS_HOME is the environment variable.
I am using cd... (6 Replies)
Hi All,
I have below variable,
xyz=\$AI_XFR
Now, if you will run the below command
=> echo $xyz
$AI_XFR
It is returning hardcoded string value.
Whereas in environment, there is value in it. Like below:
=> echo $AI_XFR
/home/aditya/sandbox/xfr/
I need to resolve this... (4 Replies)
My script
----------
for i in `cat n`;do
export k=`echo "CSN: "$i` //combining CSN: and value from n
echo "$k"
awk ''{print "CSN: "$0;}'{_=29}_&&_--' file1|tail -1 >> file2
done
In the above script i cannot able to resolve $k in awk command
file n contains
------------
0000
1111
2222... (2 Replies)
Hi guys,
I have a file "abc.dat" in below format:
FILE_PATH||||$F_PATH
TABLE_LIST||||a|b|c
SYST_NM||||${SRC_SYST}
Now I am trying to read the above file and want to print the value for above dollar variables F_PATH and SRC_SYST. The problem is it's reading the dollar variables as... (5 Replies)
Discussion started by: abcabc1103
5 Replies
LEARN ABOUT MOJAVE
glgetuniformfv
GLGETUNIFORM(3G) OpenGL 3.3 GLGETUNIFORM(3G)NAME
glGetUniformfv, glGetUniformiv - Returns the value of a uniform variable
C SPECIFICATION
void glGetUniformfv(GLuint program, GLint location, GLfloat *params);
void glGetUniformiv(GLuint program, GLint location, GLint *params);
PARAMETERS
program
Specifies the program object to be queried.
location
Specifies the location of the uniform variable to be queried.
params
Returns the value of the specified uniform variable.
DESCRIPTION
glGetUniform returns in params the value(s) of the specified uniform variable. The type of the uniform variable specified by location
determines the number of values returned. If the uniform variable is defined in the shader as a boolean, int, or float, a single value will
be returned. If it is defined as a vec2, ivec2, or bvec2, two values will be returned. If it is defined as a vec3, ivec3, or bvec3, three
values will be returned, and so on. To query values stored in uniform variables declared as arrays, call glGetUniform for each element of
the array. To query values stored in uniform variables declared as structures, call glGetUniform for each field in the structure. The
values for uniform variables declared as a matrix will be returned in column major order.
The locations assigned to uniform variables are not known until the program object is linked. After linking has occurred, the command
glGetUniformLocation() can be used to obtain the location of a uniform variable. This location value can then be passed to glGetUniform in
order to query the current value of the uniform variable. After a program object has been linked successfully, the index values for uniform
variables remain fixed until the next link command occurs. The uniform variable values can only be queried after a link if the link was
successful.
NOTES
If an error is generated, no change is made to the contents of params.
ERRORS
GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.
GL_INVALID_OPERATION is generated if program is not a program object.
GL_INVALID_OPERATION is generated if program has not been successfully linked.
GL_INVALID_OPERATION is generated if location does not correspond to a valid uniform variable location for the specified program object.
ASSOCIATED GETS
glGetActiveUniform() with arguments program and the index of an active uniform variable
glGetProgram() with arguments program and GL_ACTIVE_UNIFORMS or GL_ACTIVE_UNIFORM_MAX_LENGTH
glGetUniformLocation() with arguments program and the name of a uniform variable
glIsProgram()
SEE ALSO
glCreateProgram(), glLinkProgram(), glUniform()
COPYRIGHT
Copyright (C) 2003-2005 3Dlabs Inc. Ltd. This material may be distributed subject to the terms and conditions set forth in the Open
Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.
OpenGL 3.3 03/08/2011 GLGETUNIFORM(3G)