Sponsored Content
Top Forums UNIX for Advanced & Expert Users Detecting unused variables... Post 302973086 by MadeInGermany on Friday 13th of May 2016 07:26:02 PM
Old 05-13-2016
Maybe it helps to grep out the variable assignments from your script?
Here is a clumsy attempt:
Code:
script=yourscript
perl -pe 's/.*?([[:alpha:]]\w*)=/$1\n/g; s/[^\n]*$//' $script

Then try to find the $var references in a loop, and print if not found
Code:
for var in `perl -pe 's/.*?([[:alpha:]]\w*)=/$1\n/g; s/[^\n]*$//' $script | awk 'NF>0 && s[$0]++==0'`
do
  grep '\${\{0,1\}'"$var"'\>' $script >/dev/null || echo "$var"
done

Yet it does not know if a var= is within a 'string' or "string" i.e. is not an assignment in the shell...
This User Gave Thanks to MadeInGermany For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do I get the unused space?

One of my Solaris 8 machines hd was about to die. So I used g4u to create an image of the 9gb drive and I put it in a 36gb drive. That solved my dieing hd problem. But.... How do I get my machine to see the unused 27gb of space? Any help would be greatly appreciated. (1 Reply)
Discussion started by: Spyzic
1 Replies

2. AIX

unused storage on AIX 4.3

Hi, How do I query for unused partition in AIX 4.3 with DAS and SAA storage? I know most unix administrator don't put all the capacity on the system at once. thanks, vene (1 Reply)
Discussion started by: venerayan
1 Replies

3. UNIX for Dummies Questions & Answers

delete the unused file

Hi All, Can you please let me know how to delete any files that have not been accessed in the past 28 days in a directory. Thanks, Arun (3 Replies)
Discussion started by: arunkumar_mca
3 Replies

4. AIX

how to clean Unused semaphore??

How can i clean up my unused semaphore??? (4 Replies)
Discussion started by: abhishek27
4 Replies

5. HP-UX

HP-UX using unused HDD space

Hello, I have a system with HP-UX 11.23 installed on it. There are ~36GB of unused space on the HDD. I did a very basic installation, and it created the usual volume group /dev/vg00. When I look at the output of ioscan -funC disk, I see this (and more, but irrelevant to this post): disk ... (1 Reply)
Discussion started by: goon12
1 Replies

6. Solaris

unused disk space

i Have alloted 20G in my vmware for solaris 10, upon installation, and some distribution of disk space to /,/opt,swap i just use 19G. Can i still use the 1G? How? how to see the 1G? that i did not use? how can i use it? appreciate your responce (17 Replies)
Discussion started by: kenshinhimura
17 Replies

7. AIX

Temporarily disabling unused ethernet adapter

Hi, In our AIX 5.2 server , we have one unused ethernet adapter which doesn't have cable connection . For this interface , we are getting alerts in errpt . Could you suggesthow to stop this alert ? And sametime i would like to keep this device in ODM . Is there... (1 Reply)
Discussion started by: sekarsamy
1 Replies

8. Programming

What Unix do with unused shared memory?

Hello, When creating shared memory in C, should be remove shared memory with shmctl function when don't need it. If it didn't remove, occupied shared memory stay and remain. If we create shared memory repeatedly without removing unusable shared memory, /dev/shm will full. Does Unix or... (1 Reply)
Discussion started by: pronetin
1 Replies

9. Solaris

Solaris 10: how to disable an unused HBA card

Dear all, I have a new Oracle Blade X4-2B server, running Solaris 10. The server comes with a HBA card that will not be used now. It has not fibers connected to it. As a consequence, its leds never stop flashing. My question is: how to disable this HBA card, without removing it physically... (2 Replies)
Discussion started by: Gus1971
2 Replies
GLGETACTIVEATTRIB(3G)						  [FIXME: manual]					     GLGETACTIVEATTRIB(3G)

NAME
glGetActiveAttrib - Returns information about an active attribute variable for the specified program object C SPECIFICATION
void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); PARAMETERS
program Specifies the program object to be queried. index Specifies the index of the attribute variable to be queried. bufSize Specifies the maximum number of characters OpenGL is allowed to write in the character buffer indicated by name. length Returns the number of characters actually written by OpenGL in the string indicated by name (excluding the null terminator) if a value other than NULL is passed. size Returns the size of the attribute variable. type Returns the data type of the attribute variable. name Returns a null terminated string containing the name of the attribute variable. DESCRIPTION
glGetActiveAttrib returns information about an active attribute variable in the program object specified by program. The number of active attributes can be obtained by calling glGetProgram() with the value GL_ACTIVE_ATTRIBUTES. A value of 0 for index selects the first active attribute variable. Permissible values for index range from 0 to the number of active attribute variables minus 1. A vertex shader may use either built-in attribute variables, user-defined attribute variables, or both. Built-in attribute variables have a prefix of "gl_" and reference conventional OpenGL vertex attribtes (e.g., gl_Vertex, gl_Normal, etc., see the OpenGL Shading Language specification for a complete list.) User-defined attribute variables have arbitrary names and obtain their values through numbered generic vertex attributes. An attribute variable (either built-in or user-defined) is considered active if it is determined during the link operation that it may be accessed during program execution. Therefore, program should have previously been the target of a call to glLinkProgram(), but it is not necessary for it to have been linked successfully. The size of the character buffer required to store the longest attribute variable name in program can be obtained by calling glGetProgram() with the value GL_ACTIVE_ATTRIBUTE_MAX_LENGTH. This value should be used to allocate a buffer of sufficient size to store the returned attribute name. The size of this character buffer is passed in bufSize, and a pointer to this character buffer is passed in name. glGetActiveAttrib returns the name of the attribute variable indicated by index, storing it in the character buffer specified by name. The string returned will be null terminated. The actual number of characters written into this buffer is returned in length, and this count does not include the null termination character. If the length of the returned string is not required, a value of NULL can be passed in the length argument. The type argument specifies a pointer to a variable into which the attribute variable's data type will be written. The symbolic constants GL_FLOAT, GL_FLOAT_VEC2, GL_FLOAT_VEC3, GL_FLOAT_VEC4, GL_FLOAT_MAT2, GL_FLOAT_MAT3, GL_FLOAT_MAT4, GL_FLOAT_MAT2x3, GL_FLOAT_MAT2x4, GL_FLOAT_MAT3x2, GL_FLOAT_MAT3x4, GL_FLOAT_MAT4x2, GL_FLOAT_MAT4x3, GL_INT, GL_INT_VEC2, GL_INT_VEC3, GL_INT_VEC4, GL_UNSIGNED_INT_VEC, GL_UNSIGNED_INT_VEC2, GL_UNSIGNED_INT_VEC3, GL_UNSIGNED_INT_VEC4, DOUBLE, DOUBLE_VEC2, DOUBLE_VEC3, DOUBLE_VEC4, DOUBLE_MAT2, DOUBLE_MAT3, DOUBLE_MAT4, DOUBLE_MAT2x3, DOUBLE_MAT2x4, DOUBLE_MAT3x2, DOUBLE_MAT3x4, DOUBLE_MAT4x2, or DOUBLE_MAT4x3 may be returned. The size argument will return the size of the attribute, in units of the type returned in type. The list of active attribute variables may include both built-in attribute variables (which begin with the prefix "gl_") as well as user-defined attribute variable names. This function will return as much information as it can about the specified active attribute variable. If no information is available, length will be 0, and name will be an empty string. This situation could occur if this function is called after a link operation that failed. If an error occurs, the return values length, size, type, and name will be unmodified. 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_VALUE is generated if index is greater than or equal to the number of active attribute variables in program. GL_INVALID_VALUE is generated if bufSize is less than 0. ASSOCIATED GETS
glGet() with argument GL_MAX_VERTEX_ATTRIBS. glGetProgram() with argument GL_ACTIVE_ATTRIBUTES or GL_ACTIVE_ATTRIBUTE_MAX_LENGTH. glIsProgram() SEE ALSO
glBindAttribLocation(), glLinkProgram(), glVertexAttrib(), glVertexAttribPointer() COPYRIGHT
Copyright (C) 2003-2005 3Dlabs Inc. Ltd. Copyright (C) 2010 Khronos Group. 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/. [FIXME: source] 05/30/2012 GLGETACTIVEATTRIB(3G)
All times are GMT -4. The time now is 03:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy