Sponsored Content
Top Forums Shell Programming and Scripting Manipulating a list into a two-dimensional array Post 302740729 by bartus11 on Thursday 6th of December 2012 04:38:10 PM
Old 12-06-2012
To fix spaces problem:
Code:
awk -vx="db5" '/^LSNR_/{l=$0}$1==x{print l}' tmplsnr.a

The algorithm is pretty simple. It is saving name of the last encountered listener (line starting with LSNR) and prints it when it finds database name.
This User Gave Thanks to bartus11 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reference two dimensional array in Perl sub

I am trying to reference a two dimensional array in a subroutine and can't seem to figure this one out in Perl. Does anybody know? Please enlighten me. #!/usr/bin/perl -w use constant DIM => 4; sub Shift_elements_right{ my (@Input, @Output) = @_; for ($i = 0 ; $i <= DIM ;... (5 Replies)
Discussion started by: photon
5 Replies

2. Shell Programming and Scripting

Help for record (2 dimensional array.)

I am going to develop a address book using the shell scripting commands without sed, awk, .... I am thinking to apply the concept of 2 dimenstional array. Can I create a two dimensional array for the insertion/updation/deletion of record in unix. If yes then tell me plz or recommend me some... (1 Reply)
Discussion started by: murtaza
1 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

2 dimensional array in unix

I am trying to implementing two dimensinal array in ksh script.Would you pls help me out. I have a large size of file, File contains looks like ID SID VLAUE1 VALUE2 TOTALVALUE 1 a1 01 02 03 1 b1 02 05 07 ... (2 Replies)
Discussion started by: pritish.sas
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. Programming

C++ Segmentation error with bi-dimensional array

Hello, I'm experiencing a weird seg fault at run time when initializing a bi-dimensional array and initializing a class. Please see below code and comments describing the error and the instances when it occurs and when it does not occur. Compiled with g++ segf.cpp -o segf output On... (5 Replies)
Discussion started by: nmset
5 Replies

7. Programming

Return two dimensional array in c++

I am writing matrix multiplication and trying to return a two dimensional array from a function but I keep getting errors. Can someone please help me? here is my code (it is just the skeleton of my program): void main () { ... int *matmultiply (int, int, int, int , int , int ) ... } ... (4 Replies)
Discussion started by: saboture88
4 Replies

8. Shell Programming and Scripting

Storing two dimensional array for postprocessing

Hi Community, Would love to get some quick help on below requirement. I am trying to process mpstat output from multiple blades of my server I would like to assign this the output to an array and then use it for post processing. How can I use a two dimensional array and assign these value ... (23 Replies)
Discussion started by: sshark
23 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

Assign Two Dimensional Array In Bash At Once

Hi, I have a 10*10 two dimensional array. How do I assign value to all it's 100 elements at once? I don't want to open two for loops and assign one by one. Thanks, Shuri (1 Reply)
Discussion started by: shurimano
1 Replies
GURU(8) 						      System Manager's Manual							   GURU(8)

NAME
guru - System administration SYNOPSIS
guru [ -e program ] [ -f ] [ -p target ] DESCRIPTION
guru is a sophisticated program synthesis and system maintenance tool developed after midnight in numerous university computing labs. It is based on the famous LISP Hacker system, used to develop AI programs on TENEX. guru reads a problem description from the standard input. An innovative and occasionally correct solution is generated and written to the standard output. Typically, guru is invoked repeatedly until an acceptable solution is generated or the user community has learned to live with the problem. The bugreport mechanism sometimes invokes guru. In this case guru executes at a priority inversely proportional to the reported urgency of the bug. Feature enhancements run at high priority whereas critical problems are fixed only when the machine would otherwise be idle. If the standard input is empty, guru uses its program synthesis capabilities to generate a selection of screen editors, X widgets, compil- ers, sundry games and the occasional diatribe. OPTIONS
-e program New features are added to an existing program. This option should be used with caution as the enhanced program may behave unpre- dictably or not at all. -f Reconstructs filesystems after a crash. -p target Ports the entire system on which guru is executing to target, preferably a RISC machine. This is an extremely time consuming oper- ation and is not guaranteed to terminate. If more than one option is specified, guru may thrash. Each copy of guru has its own set of unique, additional and undocumented options. SEE ALSO
YAPS: Yet another Program Synthesiser by S C Johnson. NOTES
Inherent design limitations prevent guru from synthesising comments. The programs generated are undocumented. The lucidity, politeness, relevance and language of the occasional diatribe vary considerably. The only diagnostic is an occasional ``I deserve a raise'' - which may be ignored albeit doing so may provoke ``I resign'' - an unrecover- able error. Sending the output of one guru into another can produce quite startling results. UNIX Programmer's Manual GURU(8)
All times are GMT -4. The time now is 04:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy