Sponsored Content
Top Forums Shell Programming and Scripting Sub-string extraction on arrays Post 302438519 by radoulov on Tuesday 20th of July 2010 03:28:14 AM
Old 07-20-2010
As far as I understand the question, the answer is no (you could only avoid the temporary variable that stores the count):

Code:
${ARRAY[@]:1:${#ARRAY[@]}-2}

Actually, it seems that you need getopts.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

String extraction from user input - sh

Hi, I have a shell script to build components of a product. The follow snippet will explain what I am doing. # !/bin/sh for choice in "$@" ; do case $choice in "o") echo "Calling $choice" ; o ;; "i") echo... (8 Replies)
Discussion started by: vino
8 Replies

2. Shell Programming and Scripting

Extraction of string from Stringlist using delimiter

Hi Experts, I need to extract some set of strings one be one using delimiter. Example: shellscript.sh|unix.sh|script_file.sh i need to extract this shellscript.sh,unix.sh,script_file.sh separately. I tried but couldn't get. Please help me.. Thanks & Regards :), Kanda (3 Replies)
Discussion started by: spkandy
3 Replies

3. Shell Programming and Scripting

nasty string extraction problem

Hello, if I have a file containing a chunk of HTML and I want to extract always the string beginning http://www.xxx.com/v/ that ends just before "> (i.e. and including the bit BqqtJpfZElQ&hl will change randomly) Any ideas??? # cat randomfeature.html <object width="160"... (3 Replies)
Discussion started by: kevinyeandel1
3 Replies

4. Shell Programming and Scripting

Extraction of the output from a string.

Hi Everyone, I stored the result of a certain awk script in the variable arr.The result is /inets /banking /tools. arr= /inets /banking /tools These are 3 direcctories. I should be able to move in to these directories using "cd" command.Can you tell me how to extract... (5 Replies)
Discussion started by: saicharantej
5 Replies

5. UNIX for Dummies Questions & Answers

String extraction from a text file

The following script code works great for extracting 'postmaster' from a line of text stored in a variable named string: string="PenaltyError:=554 5.7.1 Error, send your mail to postmaster@LOCALDOMAIN" stuff=$( echo $string | cut -d@ -f1 | awk '{ print $NF }' ) echo $stuff However, I need to be... (9 Replies)
Discussion started by: cleanden
9 Replies

6. Shell Programming and Scripting

Need help in string extraction using regular expressions

Hi, I am a new bee to this forum. I am trying to extract the text after a matching pattern from a url using regular expression. Ex: http://locatlhost:2020/proxy/checkthisout I want to extract the string after proxy/. I am not familiar with reg ex. Can someone please help? (2 Replies)
Discussion started by: akatraga
2 Replies

7. Shell Programming and Scripting

String Extraction in Perl

I have a string stored in a variable. For instance, $str = " Opcode called is : CM_OP_xxx " where xxx changes dynamically and can be either LOGIN or SEARCH..... depends on runtime. For example : $str = " Opcode called is : CM_OP_SEARCH " $str = " Opcode called is : CM_OP_LOGIN " I... (3 Replies)
Discussion started by: vkca
3 Replies

8. Solaris

string extraction won't work. Why?

#!/usr/bin/ksh set -x testfile=my.test.file.flag echo ${testfile: (-4)} #/home/maldohe/scripts/spawn1& sleep 3 echo myspawn is now ending exit Background: I am trying to extract the word flag from anf given file name. This is a demo script that I am working on to fix a production issue.... (8 Replies)
Discussion started by: Harleyrci
8 Replies

9. UNIX for Dummies Questions & Answers

String extraction from log file

Hi, Log file will contain text like below: May 7 14:12:09 nap_fujitsu-nexus_pbb-denek-01-r_DE.de.ignite.net 108767: 115673: May 7 14:12:08: %RTT-3-IPSLATHRESHOLD: IP SLA Monitor(112): Threshold below for rtt May 8 14:12:09 nap_fujitsu-nexus_pbb-denek-01-r_DE.de.ignite.net 108767: 115673:... (3 Replies)
Discussion started by: Dip
3 Replies

10. Shell Programming and Scripting

String Extraction

I am trying to extract a time from the below string in perl but not able to get the time properly I just want to extract the time from the above line I am using the below syntax x=~ /(.*) (\d+)\:(\d+)\:(\d+),(.*)\.com/ $time = $2 . ':' . $3 . ':' . $4; print $time Can... (1 Reply)
Discussion started by: karan8810
1 Replies
GLINTERLEAVEDARRAYS(3G) 												   GLINTERLEAVEDARRAYS(3G)

NAME
glInterleavedArrays - simultaneously specify and enable several interleaved arrays C SPECIFICATION
void glInterleavedArrays( GLenum format, GLsizei stride, const GLvoid *pointer ) PARAMETERS
format Specifies the type of array to enable. Symbolic constants GL_V2F, GL_V3F, GL_C4UB_V2F, GL_C4UB_V3F, GL_C3F_V3F, GL_N3F_V3F, GL_C4F_N3F_V3F, GL_T2F_V3F, GL_T4F_V4F, GL_T2F_C4UB_V3F, GL_T2F_C3F_V3F, GL_T2F_N3F_V3F, GL_T2F_C4F_N3F_V3F, and GL_T4F_C4F_N3F_V4F are accepted. stride Specifies the offset in bytes between each aggregate array element. DESCRIPTION
glInterleavedArrays lets you specify and enable individual color, normal, texture and vertex arrays whose elements are part of a larger aggregate array element. For some implementations, this is more efficient than specifying the arrays separately. If stride is 0, the aggregate elements are stored consecutively. Otherwise, stride bytes occur between the beginning of one aggregate array element and the beginning of the next aggregate array element. format serves as a ``key'' describing the extraction of individual arrays from the aggregate array. If format contains a T, then texture coordinates are extracted from the interleaved array. If C is present, color values are extracted. If N is present, normal coordinates are extracted. Vertex coordinates are always extracted. The digits 2, 3, and 4 denote how many values are extracted. F indicates that values are extracted as floating-point values. Colors may also be extracted as 4 unsigned bytes if 4UB follows the C. If a color is extracted as 4 unsigned bytes, the vertex array element which follows is located at the first possible floating-point aligned address. NOTES
glInterleavedArrays is available only if the GL version is 1.1 or greater. If glInterleavedArrays is called while compiling a display list, it is not compiled into the list, and it is executed immediately. Execution of glInterleavedArrays is not allowed between the execution of glBegin and the corresponding execution of glEnd, but an error may or may not be generated. If no error is generated, the operation is undefined. glInterleavedArrays is typically implemented on the client side. Vertex array parameters are client-side state and are therefore not saved or restored by glPushAttrib and glPopAttrib. Use glPushClientAttrib and glPopClientAttrib instead. When the GL_ARB_multitexture extension is supported, glInterleavedArrays only updates the texture coordinate array for the active active texture unit. The texture coordinate state for other client texture units is not update, regardless if they are enabled or not. ERRORS
GL_INVALID_ENUM is generated if format is not an accepted value. GL_INVALID_VALUE is generated if stride is negative. SEE ALSO
glArrayElement(3G), glClientActiveTextureARB(3G), glColorPointer(3G), glDrawArrays(3G), glDrawElements(3G), glEdgeFlagPointer(3G), glEnableClientState(3G), glGetPointer(3G), glIndexPointer(3G), glNormalPointer(3G), glTexCoordPointer(3G), glVertexPointer(3G) GLINTERLEAVEDARRAYS(3G)
All times are GMT -4. The time now is 01:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy