Sponsored Content
Top Forums Shell Programming and Scripting Multi Dimensional array in KSH Post 302269899 by sinpeak on Friday 19th of December 2008 03:02:37 AM
Old 12-19-2008
Multi Dimensional array in KSH

Is there any way to use multi dim. array in KSH ?
sinpeak
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can there be multi-dimensional variable arrays in borne shell?

Hello - I've serached the web but can't find much on array script variables (except that C-shell variables are arrays!) I'm trying to form a 2-D string array: (this is what I want, but in java) String list = { {"one", "two"}, {"three"} }; I know this is a 1-D string array shell... (4 Replies)
Discussion started by: jparker
4 Replies

2. Programming

Multi-Dimensional Arrays

So, I'm fooling around with multi demtional arrays, and I made this in a short amount of time: #include <stdio.h> main(int argc, char *argv) { char blah = { {'a', 'b'}, {'b', 'a'} }; int i = 0; while (i < 2) { if (argv == blah) printf("%c\n", blah); i++; } } The goal... (3 Replies)
Discussion started by: Octal
3 Replies

3. Shell Programming and Scripting

Manipulating Pick multi dimensional data with awk.

Hi. I am reasonably new to awk, but have done quite a lot of unix scripting in the past. I have resolved the issues below with unix scripting but it runs like a dog. Moved to awk for speed and functionality but running up a big learning curve in a hurry, so hope there is some help here. I... (6 Replies)
Discussion started by: mike.strategis
6 Replies

4. Shell Programming and Scripting

PHP: how can I delete empty/NULL elements from a multi-dimensional array.

Hi all I have a file that i'm running and exec(cat ./dat) against..and putting its contents into any array, then doing an exploding the array into a multi-dimension array... The 15 multi-dimensional arrays have elements that are null/empty, I would like to remove/unset these elements and then... (2 Replies)
Discussion started by: zeekblack
2 Replies

5. Shell Programming and Scripting

PHP: Search Multi-Dimensional(nested) array and export values of currenly worked on array.

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

6. Shell Programming and Scripting

Match elements in an AWK multi-dimensional array

Hello, I have two files in the following format; file1: A B C D E F G H I J K L file2: 1 2 3 4 5 6 7 8 9 10 11 12 I have read them both in to multi-dimensional arrays. I need a file that has column 2 of the first file printed out for each column 3 of the second file ie... ... (3 Replies)
Discussion started by: cold_Que
3 Replies

7. Shell Programming and Scripting

sorting multi dimensional array

Hi there, Can someone let me know how to sort the 2 dimensional array below by column 1 then by column 2? 22 55 2222 2230 33 66 44 58 222 240 11 25 22 60 33 45 output: 11 25 22 55 22 60 33 45 33 66 44 58 (6 Replies)
Discussion started by: phoeberunner
6 Replies

8. UNIX for Dummies Questions & Answers

Help: stdin to multi-dimensional array

I cant get out of this while loop at the beginning of my program. Just reading from stdin one char at a time and storing it into a multi-array. Need to fix it with in two hours. #include <sys/wait.h> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <unistd.h> #include... (1 Reply)
Discussion started by: unt_engn
1 Replies

9. Shell Programming and Scripting

Multi Dimensional array

I have an array of names. Each one of the name, has a number represented to it. For example A has an ID 8, B has an ID 2. What I am after is a for loop that when the array is in position 1, a particular variable is set to the value of position 1 in array 2 declare -a arr=("A" "B" "C"... (6 Replies)
Discussion started by: nms
6 Replies

10. Shell Programming and Scripting

Multi Dimensional array in bash

Hi, I'm developing a script which contains a multi dimensional array, however for some reason the array is not iterating. When executing the script, services are listed as arguments from argument 2. Ex voice data sms. service=${@:2}; for services in $service do ... (2 Replies)
Discussion started by: nms
2 Replies
reference_element(7rheolef)					    rheolef-6.1 				       reference_element(7rheolef)

NAME
reference_element - reference element SYNOPSYS
The reference_element class defines all supported types of geometrical elements in one, two and three dimensions. The set of supported ele- ments are designate by a letter p point (dimension 0) e edge (dimension 1) t triangle(dimension 2) q quadrangle(dimension 2) T tetrahedron(dimension 3) P prism(dimension 3) H hexaedron(dimension 3) IMPLEMENTATION
class reference_element { public: // typedefs: typedef std::vector<int>::size_type size_type; // defines variant_type { p, t, q ..., H, ...}; // in an automatically generated file : typedef size_type variant_type; static const variant_type p = 0, e = 1, t = 2, q = 3, T = 4, P = 5, H = 6, max_variant = 7; // allocators/deallocators: reference_element (variant_type x = max_variant) : _x(x) { assert_macro (x >= 0 && x <= max_variant, "invalid type " << x); } // accessors: variant_type variant() const { return _x; } char name() const { return _name[_x]; } size_type dimension() const { return _dimension[_x]; } friend Float measure (reference_element hat_K); size_type size() const { return _n_vertex[_x]; } size_type n_subgeo(size_type subgeo_dim) const { return n_subgeo (variant(), subgeo_dim); } size_type n_edge() const { return n_subgeo(1); } size_type n_face() const { return n_subgeo(2); } size_type subgeo_size (size_type subgeo_dim, size_type loc_isid) const { return subgeo_n_node (_x, 1, subgeo_dim, loc_isid); } size_type subgeo_local_vertex(size_type subgeo_dim, size_type loc_isid, size_type loc_jsidvert) const { return subgeo_local_node (_x, 1, subgeo_dim, loc_isid, loc_jsidvert); } void set_variant (variant_type x) { _x = x; } void set_variant (size_type n_vertex, size_type dim) { _x = variant (n_vertex, dim); } void set_name (char name); // helpers: static variant_type variant (char name); static variant_type variant (size_type n_vertex, size_type dim); static char name (variant_type variant) { return _name [variant]; } static size_type dimension (variant_type variant) { return _dimension[variant]; } static size_type n_vertex (variant_type variant) { return _n_vertex [variant]; } static size_type n_node (variant_type variant, size_type order); static size_type n_sub_edge (variant_type variant); static size_type n_sub_face (variant_type variant); static size_type n_subgeo (variant_type variant, size_type subgeo_dim); static size_type subgeo_n_node (variant_type variant, size_type order, size_type subgeo_dim, size_type loc_isid); static size_type subgeo_local_node (variant_type variant, size_type order, size_type subgeo_dim, size_type loc_isid, size_type loc_jsidnod); static variant_type first_variant_by_dimension (size_type dim) { return _first_variant_by_dimension[dim]; } static variant_type last_variant_by_dimension (size_type dim) { return _first_variant_by_dimension[dim+1]; } static size_type first_inod_by_variant (variant_type variant, size_type order, variant_type subgeo_variant); static size_type last_inod_by_variant (variant_type variant, size_type order, variant_type subgeo_variant) { return first_inod_by_variant (variant, order, subgeo_variant+1); } static size_type first_inod (variant_type variant, size_type order, size_type subgeo_dim) { return first_inod_by_variant (variant, order, first_variant_by_dimension(subgeo_dim)); } static size_type last_inod (variant_type variant, size_type order, size_type subgeo_dim) { return first_inod_by_variant (variant, order, last_variant_by_dimension(subgeo_dim)); } static void init_local_nnode_by_variant (size_type order, boost::array<size_type,reference_element::max_variant>& loc_nnod_by_variant); protected: // constants: static const char _name [max_variant]; static const size_type _dimension [max_variant]; static const size_type _n_vertex [max_variant]; static const variant_type _first_variant_by_dimension[5]; // data: variant_type _x; }; rheolef-6.1 rheolef-6.1 reference_element(7rheolef)
All times are GMT -4. The time now is 12:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy