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 REDHAT
slarrb
SLARRB(l) ) SLARRB(l)
NAME
SLARRB - the relatively robust representation(RRR) L D L^T, SLARRB does ``limited'' bisection to locate the eigenvalues of L D L^T,
SYNOPSIS
SUBROUTINE SLARRB( N, D, L, LD, LLD, IFIRST, ILAST, SIGMA, RELTOL, W, WGAP, WERR, WORK, IWORK, INFO )
INTEGER IFIRST, ILAST, INFO, N
REAL RELTOL, SIGMA
INTEGER IWORK( * )
REAL D( * ), L( * ), LD( * ), LLD( * ), W( * ), WERR( * ), WGAP( * ), WORK( * )
PURPOSE
Given the relatively robust representation(RRR) L D L^T, SLARRB does ``limited'' bisection to locate the eigenvalues of L D L^T, W( IFIRST
) thru' W( ILAST ), to more accuracy. Intervals [left, right] are maintained by storing their mid-points and semi-widths in the arrays W
and WERR respectively.
ARGUMENTS
N (input) INTEGER
The order of the matrix.
D (input) REAL array, dimension (N)
The n diagonal elements of the diagonal matrix D.
L (input) REAL array, dimension (N-1)
The n-1 subdiagonal elements of the unit bidiagonal matrix L.
LD (input) REAL array, dimension (N-1)
The n-1 elements L(i)*D(i).
LLD (input) REAL array, dimension (N-1)
The n-1 elements L(i)*L(i)*D(i).
IFIRST (input) INTEGER
The index of the first eigenvalue in the cluster.
ILAST (input) INTEGER
The index of the last eigenvalue in the cluster.
SIGMA (input) REAL
The shift used to form L D L^T (see SLARRF).
RELTOL (input) REAL
The relative tolerance.
W (input/output) REAL array, dimension (N)
On input, W( IFIRST ) thru' W( ILAST ) are estimates of the corresponding eigenvalues of L D L^T. On output, these estimates are
``refined''.
WGAP (input/output) REAL array, dimension (N)
The gaps between the eigenvalues of L D L^T. Very small gaps are changed on output.
WERR (input/output) REAL array, dimension (N)
On input, WERR( IFIRST ) thru' WERR( ILAST ) are the errors in the estimates W( IFIRST ) thru' W( ILAST ). On output, these are
the ``refined'' errors.
WORK (input) REAL array, dimension (???)
Workspace.
IWORK (input) INTEGER array, dimension (2*N)
Workspace.
INFO (output) INTEGER
Error flag.
FURTHER DETAILS
Based on contributions by
Inderjit Dhillon, IBM Almaden, USA
Osni Marques, LBNL/NERSC, USA
LAPACK version 3.0 15 June 2000 SLARRB(l)