09-26-2006
You do not need to initialize anything in a shell. You can just start assigning values to the various array elements. If you leave any gaps those will remain null.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I wish to store $string1 in $string1array a character in each array element.
Then i wish to echo the entire array to the screen so that it reads as the normal string again.
I have been trying with the code below but does not work. Please help...
To put string into array:
... (5 Replies)
Discussion started by: rorey_breaker
5 Replies
2. Programming
I am facing a strange error while creating posix threads:
Given below are two snippets of code, the first one works whereas the second one gives a garbage value in the output.
Snippet 1
This works:
--------------
int *threadids;
threadids = (int *) malloc (num_threads * sizeof(int));
... (4 Replies)
Discussion started by: kmehta
4 Replies
3. Shell Programming and Scripting
Hi All,
I'm writing a nagios check that will see if our ldap servers are in sync...
I got the status data into a nested array, I would like to search key of each array and if "OK" is NOT present, echo other key=>values in the current array to a variable
so...eg...let take the single array... (1 Reply)
Discussion started by: zeekblack
1 Replies
4. Shell Programming and Scripting
Hi Everyone,
#!/usr/bin/perl
use strict;
use warnings;
my @test=("a;b;qqq;c;d","a;b;ggg;c;d","a;b;qqq;c;d");
would like to split the @test array into two array:
@test1=(("a;b;qqq;c;d","a;b;qqq;c;d"); and @test2=("a;b;ggg;c;d");
means search for 3rd filed.
Thanks
find the... (0 Replies)
Discussion started by: jimmy_y
0 Replies
5. Shell Programming and Scripting
Hi
I want to write a script which store all the parameters passed to the script into an array.
Once it is stored I want scan through the array and and delete those files for last month present inside the directory. The files in directory is appneded with YYYY_MM_DD.
I want to know how can I... (3 Replies)
Discussion started by: dgmm
3 Replies
6. Shell Programming and Scripting
I have an array and two variables as below,
I need to check if $datevar is present in $filename.
If so, i need to replace $filename with the values in the array.
I need the output inside an ARRAY
How can this be done.
Any help will be appreciated. Thanks in advance. (2 Replies)
Discussion started by: irudayaraj
2 Replies
7. Shell Programming and Scripting
Trying to do some control flow parsing based on the index postion of an array member. Here is the pseudo code I am trying to write in (preferably in pure bash) where possible. I am thinking regex with do the trick, but need a little help.
pesudo code
if == ENDSINFIVEINTS ]]; then
do... (4 Replies)
Discussion started by: briandanielz
4 Replies
8. Shell Programming and Scripting
Hi All
I have multiple arrays like below.
set -A val1 1 2 4 5
set -A val2 a b c d
.
.
.
Now i would like to pass the individual arrays one by one to a function and display/ do some action.
Note : I am using ksh
Can you please advise any solution...
Thanks in advance. (7 Replies)
Discussion started by: Girish19
7 Replies
9. Shell Programming and Scripting
hello,
i need a bit of help on how to do this effectively in bash without a lot of extra looping or massive switch/case
i have a long array of M elements and a short array of N elements, so M > N always. M is not a multiple of N.
for case 1, I want to stretch N to fit M
arrayHuge
H = (... (2 Replies)
Discussion started by: f77hack
2 Replies
10. Shell Programming and Scripting
Hi All,
need help with reading the array and sum of the array elements.
given an array of integers of size N . You need to print the sum of the elements in the array, keeping in mind that some of those integers may be quite large.
Input Format
The first line of the input consists of an... (1 Reply)
Discussion started by: nishantrefound
1 Replies
LEARN ABOUT SUSE
glindexpointer
GLINDEXPOINTER(3G) GLINDEXPOINTER(3G)
NAME
glIndexPointer - define an array of color indexes
C SPECIFICATION
void glIndexPointer( GLenum type,
GLsizei stride,
const GLvoid *ptr )
PARAMETERS
type Specifies the data type of each color index in the array. Symbolic constants GL_UNSIGNED_BYTE, GL_SHORT, GL_INT, GL_FLOAT, and
GL_DOUBLE are accepted. The initial value is GL_FLOAT.
stride Specifies the byte offset between consecutive color indexes. If stride is 0 (the initial value), the color indexes are understood
to be tightly packed in the array. The initial value is 0.
ptr Specifies a pointer to the first index in the array. The initial value is 0.
DESCRIPTION
glIndexPointer specifies the location and data of an array of color indexes to use when rendering. type specifies the data type of each
color index and stride gives the byte stride from one color index to the next allowing vertices and attributes to be packed into a single
array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see glInterleavedArrays.)
type, stride, and ptr are saved as client-side state.
The color index array is initially disabled. To enable and disable the array, call glEnableClientState and glDisableClientState with the
argument GL_INDEX_ARRAY. If enabled, the color index array is used when glDrawArrays, glDrawElements or glArrayElement is called.
Use glDrawArrays to construct a sequence of primitives (all of the same type) from prespecified vertex and vertex attribute arrays. Use
glArrayElement to specify primitives by indexing vertices and vertex attributes and glDrawElements to construct a sequence of primitives by
indexing vertices and vertex attributes.
NOTES
glIndexPointer is available only if the GL version is 1.1 or greater.
The color index array is initially disabled, and it isn't accessed when glArrayElement, glDrawElements, or glDrawArrays is called.
Execution of glIndexPointer is not allowed between glBegin and the corresponding glEnd, but an error may or may not be generated. If an
error is not generated, the operation is undefined.
glIndexPointer is typically implemented on the client side.
Since the color index array parameters are client-side state, they are not saved or restored by glPushAttrib and glPopAttrib. Use
glPushClientAttrib and glPopClientAttrib instead.
ERRORS
GL_INVALID_ENUM is generated if type is not an accepted value.
GL_INVALID_VALUE is generated if stride is negative.
ASSOCIATED GETS
glIsEnabled with argument GL_INDEX_ARRAY
glGet with argument GL_INDEX_ARRAY_TYPE
glGet with argument GL_INDEX_ARRAY_STRIDE
glGetPointerv with argument GL_INDEX_ARRAY_POINTER
SEE ALSO
glArrayElement(3G), glColorPointer(3G), glDrawArrays(3G), glDrawElements(3G), glEdgeFlagPointer(3G), glEnable(3G), glGetPointerv(3G),
glInterleavedArrays(3G), glNormalPointer(3G), glPopClientAttrib(3G), glPushClientAttrib(3G), glTexCoordPointer(3G), glVertexPointer(3G)
GLINDEXPOINTER(3G)