Sponsored Content
Top Forums Shell Programming and Scripting How to get result of sqlcmd output in variable? Post 302885567 by Corona688 on Monday 27th of January 2014 11:23:44 AM
Old 01-27-2014
Agreed, it is better to store large things like query outputs it in a file than a variable... Depending on your system, variables may have surprisingly small maximum sizes. Keeping it in a variable also makes it harder to loop inside the shell, harder to use with external utilities, and can cause lots of quoting problems.

But for the record, you can store program output in a variable by doing:

Code:
VARIABLE=$( program statement )

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

output result (period -1)

hello, I have the following basic script which input the period, but I would like to output is period -1.. how? echo Please input period (yyyymm): read PERIOD OUTPUT=$PERIOD -1 echo " you request period -1 is $OUT" input 200705 output 200704 input 200701 output 200612 The above... (4 Replies)
Discussion started by: happyv
4 Replies

2. UNIX and Linux Applications

How to get a result of a cmd into variable?

Hi , I am trying following . I need to get a result of an autosys cmd into a unix variable. The autosys cmd is autostatus -G jpm_day_today Please help me in storing the value returned by this cmd into a unix variable. Appreciate your time to read this post. (1 Reply)
Discussion started by: manchau
1 Replies

3. Shell Programming and Scripting

Assign result to variable

Hi friends, firstly, i can run following expression and i took 100 value. sqlplus -s username/password@TTTEST @umt.sql umt.sql exists "select t.deger from parametre t where t.id=30". result of this query =100 i need to assign this value(100) to variable(for example x... (2 Replies)
Discussion started by: temhem
2 Replies

4. Shell Programming and Scripting

result in variable

Hi all, I'll try to get a result from a search with "awk" into a variable. It works for those examples: findfirstline=`awk 'BEGIN{ mycount = 1 } { if(mycount == 1 && /^Video/){ row=NR; print row; mycount = 0; }}' ${i}` findlastline=`awk '/^Video/ {row=NR} END{print row}' ${i}` But it... (6 Replies)
Discussion started by: tempestas
6 Replies

5. Shell Programming and Scripting

How to combine two variable result?

Hi, i have two variables i.e lck_ckm_customer=ckm_customer and(present in some script A) table=ckm_customer(present in script B) in script B i am executing this part if ; then --- ---- ---- fi Now, while comparing in my log file i am getting this result if but i... (2 Replies)
Discussion started by: gnnsprapa
2 Replies

6. Shell Programming and Scripting

Result of 'cut' into variable

Hello, I would like to have a result of a cut-command in a variable. The file "t.dat" has the following content: Company 001.239879123.OB1X.672W12.STS UNOLD.001.02 My bash-script: Header="" Header=$(cut -c1-160 t.dat | head -1) echo $Header ... (9 Replies)
Discussion started by: API
9 Replies

7. UNIX for Dummies Questions & Answers

I save the result in a variable

I have friends that this command worked perfectly, but I would like to save the result in a variable, which I have not achieved var=prueba.txt echo $var | cut -d "." -f 1 prueba I need to do this but does not work me salida=echo $var | cut -d "." -f 1 echo "result:$salida" ... (8 Replies)
Discussion started by: tricampeon81
8 Replies

8. UNIX for Advanced & Expert Users

Error executing sqlcmd command through UNIX

Hi All, I am trying to execute a set of sql statements in sql server 2008 using the sqlcmd command in unix and passing the query in the "input" parameter. It is giving me an error "incorrect syntax near 2014". The below statement is giving an error : declare date_val datetime, ... (4 Replies)
Discussion started by: Rahul Raj
4 Replies

9. Shell Programming and Scripting

Store result variable

Friends have the following problem: cat $PATH_DAT/mr.txt | nawk 'BEGIN { CantPnt=0; NumReg=0; FS="|" } { NumReg++ CantPnt=CantPnt+int($2) } END{ printf... (5 Replies)
Discussion started by: tricampeon81
5 Replies

10. Shell Programming and Scripting

Assigning variable to output gives error with expected result

Hello, I am trying to print out the first string matching query with grep and I need your help. My scenario: Database John F 4433 Street No 88 CA Elisabeth Taylor 7733 Street No 26 ON Jack Nicholson 0133 Green Park No 34 AR John F 2 9399 Southpark No 02D UT test.sh... (6 Replies)
Discussion started by: baris35
6 Replies
GLGETUNIFORM(3G)						   OpenGL Manual						  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); void glGetUniformuiv(GLuint program, GLint location, GLuint *params); void glGetUniformdv(GLuint program, GLint location, GLdouble *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/. AUTHORS
opengl.org opengl.org 06/10/2014 GLGETUNIFORM(3G)
All times are GMT -4. The time now is 10:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy