Sponsored Content
Top Forums Shell Programming and Scripting why double brackets for array loop? Post 302338812 by sparcguy on Wednesday 29th of July 2009 03:10:27 AM
Old 07-29-2009
maybe some special character it cannot understand ( without ((. You must pad it

sometime back I had similar problem using square brackets, a forumer here advised to use [[ instead of [ and it solved the problem
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

why put double square brackets in an if clause?

what is the rationale behind putting double square brackets in an if clause? for e.g. if ] || ] || ]; then echo some fields are null fi (5 Replies)
Discussion started by: napolayan
5 Replies

2. UNIX for Dummies Questions & Answers

brackets vs parentheses - single and double

hi, unix gurus. i am wondering if someone can give me a clear explanation of the differneces between parentheses and brackets, both single and double. i have heard that double parentheses (( are used for numerical expressions and that single brackets [ are used for strings. but i see... (1 Reply)
Discussion started by: ankimo
1 Replies

3. Shell Programming and Scripting

WHy the double square brackets?

One of the senior administrators gave me a shell script to modify and it begins as follows: if ] && ] {more code follows} Why the double square brackets? (10 Replies)
Discussion started by: mojoman
10 Replies

4. Shell Programming and Scripting

Use of double square brackets in ksh

Hi First apologies if this has been raised before. I've got the following in a ksh script: if ] For some reason this does not work. But if I remove the double square brackets to: if This works. I thought ksh supported the ]. Or is there more to it? Thanks in advance. (3 Replies)
Discussion started by: tsu3000
3 Replies

5. Shell Programming and Scripting

Double square brackets question

Hi, I just came across an interesting shell script syntax like the one below: ] && (trap 'rm -rf ${WORK_DIR}/*.$$; echo "\n\nInterrupted !!\n\n"; exit 4' 1 2 3 15) Can someone please explain the code snippet above? The trap command bit is fine but ] && is the hazy part. Generally we use an... (2 Replies)
Discussion started by: King Nothing
2 Replies

6. Shell Programming and Scripting

Array with do while and if loop

Hi All, I am trying to run a do while for an array. And in the do while, I'm trying to get a user response. Depending on the the answer, I go ahead and do something or I move on to next element in the array. So far I can read the array, but I can't get the if statement to work. Any suggestions... (5 Replies)
Discussion started by: nitin
5 Replies

7. UNIX for Dummies Questions & Answers

Single or double square brackets

Hi frieds, I don't understand the difference between single square bracket and double square brackets in a IF condition. Ex. if ; then RETURNJOB=1 else RETURNJOB=0 fi It run, but this if ]; then RETURNJOB=1 else RETURNJOB=0 fi (4 Replies)
Discussion started by: dogshort
4 Replies

8. Shell Programming and Scripting

Array Variable being Assigned Values in Loop, But Gone when Loop Completes???

Hello All, Maybe I'm Missing something here but I have NOOO idea what the heck is going on with this....? I have a Variable that contains a PATTERN of what I'm considering "Illegal Characters". So what I'm doing is looping through a string containing some of these "Illegal Characters". Now... (5 Replies)
Discussion started by: mrm5102
5 Replies

9. Shell Programming and Scripting

awk loop using array:wish to store array values from loop for use outside loop

Here's my code: awk -F '' 'NR==FNR { if (/time/ && $5>10) A=$2" "$3":"$4":"($5-01) else if (/time/ && $5<01) A=$2" "$3":"$4-01":"(59-$5) else if (/time/ && $5<=10) A=$2" "$3":"$4":0"($5-01) else if (/close/) { B=0 n1=n2; ... (2 Replies)
Discussion started by: klane
2 Replies

10. Shell Programming and Scripting

Bash for loop array

Hi there, A bit new to bash and am having an issue with a for loop. I look for filenames in a specified directory and pull the date string from each meeting a certain criteria, and then would like to make a directory for each date found, like this: search 20180101.gz 20180102.gz 20180103.gz... (5 Replies)
Discussion started by: mwheeler12
5 Replies
dlar2v.f(3)							      LAPACK							       dlar2v.f(3)

NAME
dlar2v.f - SYNOPSIS
Functions/Subroutines subroutine dlar2v (N, X, Y, Z, INCX, C, S, INCC) DLAR2V Function/Subroutine Documentation subroutine dlar2v (integerN, double precision, dimension( * )X, double precision, dimension( * )Y, double precision, dimension( * )Z, integerINCX, double precision, dimension( * )C, double precision, dimension( * )S, integerINCC) DLAR2V Purpose: DLAR2V applies a vector of real plane rotations from both sides to a sequence of 2-by-2 real symmetric matrices, defined by the elements of the vectors x, y and z. For i = 1,2,...,n ( x(i) z(i) ) := ( c(i) s(i) ) ( x(i) z(i) ) ( c(i) -s(i) ) ( z(i) y(i) ) ( -s(i) c(i) ) ( z(i) y(i) ) ( s(i) c(i) ) Parameters: N N is INTEGER The number of plane rotations to be applied. X X is DOUBLE PRECISION array, dimension (1+(N-1)*INCX) The vector x. Y Y is DOUBLE PRECISION array, dimension (1+(N-1)*INCX) The vector y. Z Z is DOUBLE PRECISION array, dimension (1+(N-1)*INCX) The vector z. INCX INCX is INTEGER The increment between elements of X, Y and Z. INCX > 0. C C is DOUBLE PRECISION array, dimension (1+(N-1)*INCC) The cosines of the plane rotations. S S is DOUBLE PRECISION array, dimension (1+(N-1)*INCC) The sines of the plane rotations. INCC INCC is INTEGER The increment between elements of C and S. INCC > 0. Author: Univ. of Tennessee Univ. of California Berkeley Univ. of Colorado Denver NAG Ltd. Date: November 2011 Definition at line 111 of file dlar2v.f. Author Generated automatically by Doxygen for LAPACK from the source code. Version 3.4.1 Sun May 26 2013 dlar2v.f(3)
All times are GMT -4. The time now is 08:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy