05-18-2002
To start with, something like:
eval echo \$$counter
will do what you want. But this a terrible way to loop through the parameters. It will not be general. After $9 you be stuck. There is no $10.
One way to loop though the parms is
#! /usr/bin/ksh
for parm ; do
echo $parm is a parameter
done
when you leave off the "in" cause of a "for" statement, you will automatically loop though the parameters.
The next way, and the more common solution, is to use the "shift" command. When the script executes a "shift", $1 disappears. And what used to be $2 is now $1 and so on.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am using bash script
I want some help in handling loops in my script...
I need to check for a specific interval of time whether a file in a paritcular directory exists. If exists, i need to do some action and continue with the next iteration..
//my script
attempt=0... (1 Reply)
Discussion started by: borncrazy
1 Replies
2. Shell Programming and Scripting
Say I write something like the following:
var1=1
var2=2
for int in 1 2
do
echo "\$var$int"
done
I want the output to be:
1
2
Instead I get something like:
$var1
$var2 (2 Replies)
Discussion started by: Awanka
2 Replies
3. Shell Programming and Scripting
Helo Experts,
I need a help in handling errors in shell script, wants my errors displayed in text file instead of command window..
My shell script is here;
cd /cygdrive/s/Files
for FILES in ./*.*
do
temp=`basename $FILES`
if cp $FILES /cygdrive/r/CopyFile1/$FILES; then
echo "copy... (5 Replies)
Discussion started by: CelvinSaran
5 Replies
4. Shell Programming and Scripting
Hi
I am looking for a unix command or a small shell script which can takes one parameter and then searches for the passed in the parameter in any or all files under say /home/dev/
Can anyone please help me on this? (3 Replies)
Discussion started by: pankaj80
3 Replies
5. Shell Programming and Scripting
i am passing input parameter 'one_two' to the script , the script output should display the result as below
one_1two
one_2two
one_3two
if
then
echo " Usage : <$0> <DATABASE> "
exit 0
else
for DB in 1 2 3
do
DBname=`$DATABASE | awk -F "_" '{print $1_${DB}_$2}`
done
fi (5 Replies)
Discussion started by: only4satish
5 Replies
6. Shell Programming and Scripting
hi all,
i have a parameter file of following format, i want a method which can get the value of specific parameter.
parameter file format:
<Parameter Name="FileLocationWindows">
<Description>
The directory location of the logger file.
... (1 Reply)
Discussion started by: laxmikant.hcl
1 Replies
7. Shell Programming and Scripting
Hi,
I have the following files.
->cat scr.sh
export TMP_DIR=/home/user/folder1
export TMP_DIR_2=/home/user/folder2
while read line
do
cat "$line"
done<file_list.dat
------------------------
-> cat file_list.dat
$TMP_DIR/file1.txt
$TMP_DIR_2/file2.txt
---------------------------
-> cat... (6 Replies)
Discussion started by: barath
6 Replies
8. Shell Programming and Scripting
hi,
I am using parameter to get the new hour as below
time=30
time1=1 hours
v_StartTime=`date +'%F %T'`
v_EndTime=`date +'%F %T' -d ''$time' minutes'`
v_EndTime1=`date +'%F %T' -d ''$time1'`
echo $v_StartTime
echo $v_EndTime
echo $v_EndTime1
but i am getting error as
test.ksh:... (1 Reply)
Discussion started by: ATWC
1 Replies
9. Shell Programming and Scripting
Hi.
How do I achieve this
sh /EDWH-DMT02/script/MISC/exec_sql.sh "@/EDWH-DMT02/script/others/CSM_CKC/Complete_List.sql ${file_name}" Complete_List.txt
The /EDWH-DMT02/script/MISC/exec_sql.sh has two parameters and it's working fine with this
sh /EDWH-DMT02/script/MISC/exec_sql.sh... (7 Replies)
Discussion started by: aimy
7 Replies
10. Shell Programming and Scripting
Hello All,
Could you please do help me here as I would like to perform parameter expansion in shell over a parameter expansion.
Let's say I have following variable.
path="/var/talend/nat/cdc"
Now to get only nat I could do following.
path1="${path%/*}"
path1="${path1##*/}"
Here... (8 Replies)
Discussion started by: RavinderSingh13
8 Replies
LEARN ABOUT DEBIAN
glgetactiveatomiccounterbufferiv
GLGETACTIVEATOMICCOU(3G) [FIXME: manual] GLGETACTIVEATOMICCOU(3G)
NAME
glGetActiveAtomicCounterBufferiv - retrieve information about the set of active atomic counter buffers for a program
C SPECIFICATION
void glGetActiveAtomicCounterBufferiv(Gluint program, GLuint bufferIndex, GLenum pname, GLint *params);
PARAMETERS
program
The name of a program object from which to retrieve information.
bufferIndex
Specifies index of an active atomic counter buffer.
pname
Specifies which parameter of the atomic counter buffer to retrieve.
params
Specifies the address of a variable into which to write the retrieved information.
DESCRIPTION
glGetActiveAtomicCounterBufferiv retrieves information about the set of active atomic counter buffers for a program object. program is the
name of a program object for which the command glLinkProgram() has been issued in the past. It is not necessary for program to have been
linked successfully. The link may have failed because the number of active atomic counters exceeded the limits.
bufferIndex specifies the index of an active atomic counter buffer and must be in the range zero to the value of
GL_ACTIVE_ATOMIC_COUNTER_BUFFERS minus one. The value of GL_ACTIVE_ATOMIC_COUNTER_BUFFERS for program indicates the number of active atomic
counter buffer and can be queried with glGetProgram().
If no error occurs, the parameter(s) specified by pname are returned in params. If an error is generated, the contents of params are not
modified.
If pname is GL_ATOMIC_COUNTER_BUFFER_BINDING, then the index of the counter buffer binding point associated with the active atomic counter
buffer bufferIndex for program is returned.
If pname is GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE, then the implementation-dependent minimum total buffer object size, in baseic machine
units, required to hold all active atomic counters in the atomic counter binding point identified by bufferIndex is returned.
If pname is GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS, then the number of active atomic counters for the atomic counter buffer
identified by bufferIndex is returned.
If pname is GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES, then a list of the active atomic counter indices for the atomic counter
buffer identified by bufferIndex is returned. The number of elements that will be written into params is the value of
GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS for bufferIndex.
If pname is GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER, GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER,
GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER, GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER, or
GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER, then a boolean value indicating whether the atomic counter buffer identified by
bufferIndex is referenced by the vertex, tessellation control, tessellation evaluation, geometry or fragment processing stages of program,
respectively, is returned.
NOTES
glGetActiveAtomicCounterBufferiv is available only if the GL version is 4.2 or higher.
ERRORS
GL_INVALID_VALUE is generated if program is not the name of a program object for which glLinkProgram() has been called in the past.
GL_INVALID_VALUE is generated if bufferIndex is greater than or equal to the value of GL_ACTIVE_ATOMIC_COUNTER_BUFFERS for program.
GL_INVALID_ENUM is generated if pname is not one of the accepted tokens.
SEE ALSO
glGetProgram(), glGetActiveSubroutineUniform(), glGetActiveSubroutineUniformName(), glGetUniformLocation()
COPYRIGHT
Copyright (C) 2011 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 GLGETACTIVEATOMICCOU(3G)