Sponsored Content
Top Forums Shell Programming and Scripting Bash Array connectin to another Array Post 303003471 by batchenr on Thursday 14th of September 2017 07:48:15 AM
Old 09-14-2017
thanks for the replay but i dont think its it.
i do belive it should be with dictionary.

doing this is too specific with the key1 key2

Code:
declare -A array_name

array_name["Key1"]="Value1"
array_name["Key2"]="Value2"
array_name["Key3"]="Value3"
array_name["Key4"]="Value4"

for testkey in Key3 Key1
do
   echo "${array_name[$testkey]}"
done

i want it to go throw all the account codes and know that code=name
and echo the name
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

bash array

I'm trying to move files based on a certain day..my question is on array's, what's wrong with the way I'm stepping through the array? what i have gives me syntax errors..any ideas...so far I have #! /bin/bash sun_d=`cal |grep -v |awk '{printf " " $1}' ` echo "$sun_d" ls -l... (1 Reply)
Discussion started by: gubten
1 Replies

2. Shell Programming and Scripting

create array holding characters from sring then echo array.

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

3. Programming

Creating an array to hold posix thread ids: Only dynamic array works

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

4. 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

5. Shell Programming and Scripting

perl, put one array into many array when field is equal to sth

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

6. Shell Programming and Scripting

Store all the passed arguments in an array and display the array

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

7. Shell Programming and Scripting

PERL : Read an array and write to another array with intial string pattern checks

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

8. Shell Programming and Scripting

Array in Bash!

sorry I am new to the bash scripting since I was used to c shell programming. I am writting a script in bash for which I have to create an array in bash. I was able to do parse one variable through command line by doing": Lets say the below code is part of temp.bash and is called like: temp.bash... (5 Replies)
Discussion started by: dixits
5 Replies

9. Shell Programming and Scripting

Bash 3.2 - Array / Regex - IF 3rd member in array ends in 5 digits then do somthing...

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

10. Shell Programming and Scripting

Bash arrays: rebin/interpolate smaller array to large array

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
LE(1)							      General Commands Manual							     LE(1)

NAME
le - full screen text editor SYNOPSIS
le [options] filename DESCRIPTION
le is a text editor which offers wide range of capabilities with a simple interface. It has a pull down menu and a simple help system to get started. See KEYS section below to learn about key combinations. Among its features there are: various operations with stream and rectangular blocks, search and replace with full regular expressions, text formatting, undelete/uninsert, hex editing, tunable key sequences, tunable colors, tunable syntax highlighting. The editor currently supports only one loaded file at a time. KEYS
Here are some starting hints: F10 or C-n menu F1 help C-x exit (cancel) Arrows navigate In the editor the following key description is used: Key1-Key2 simultaneous key1 and key2 press Key1+Key2 sequential keys press Key1 | Key2 press Key1 OR Key2 ^Key Ctrl-Key ~Key Shift-Key ^~Key Ctrl-Shift-Key | Alt-Key Some of ^Fx, ~Fx, ^~Fx can be typed as ESC+Fx. The rest of key combinations can be seen in help, in menu and in the keyboard map (default one can be seen with le --dump-keymap). There is support for block filtering through an external program, a command output read-in, writing a block through a command. To read or write block from/to a command, use F4+R or F4+W and file name of the following format: ``|command args''. Filtering is achieved by F4+| followed by command name. STATUS LINE
On the status line you can see current line, column, the size of loaded file, the code of character under cursor, several one letter flags, file name, offset in bytes from the file beginning and percent position in the file. One letters flags are: * - modified; R - Russian keyboard (works only on certain terminals); I - insert, O - overstrike; A - autoindent; D - dos style line terminators (CR NL); U - undelete possible, u - uninsert possible; B - column block mode. TEXT PROTECTION
To prevent changes loss on crash, le regularly dumps the editing text, if changed, to ~/.le/tmp/FILENAME.PID , where FILENAME is the file name with slashes converted to underlines; PID is the process id of the editor process. When the editor gets a fatal signal, it also dumps the text, to ~/.le/tmp/DUMP-SIG-FILENAME.PID , where SIG is the signal number. OPTIONS
-r, --read-only Work as viewer, don't allow changes. If your system supports mmap(2), it will be used to get file contents to memory. -h, --hex-mode Start in hex mode --mmap Use mmap(2) to load file read-only. Can be used to view very large files or even devices. This implies -h. --mmap-rw Use mmap(2) to load file read-write in MAP_SHARED mode. Use with caution -- the changes go directly to file or disk, no undo. In this mode only replace can be used, but it allows editing of very large files or even devices. This implies -h. -b, --black-white Start in black & white mode -c, --color Start in color mode --dump-keymap Dump default keymap to stdout and exit --dump-colors Dump default color map to stdout and exit --version Print the version of LE and exit --help Print short description of options and exit FILES
DATADIR/colors ~/.le/colors DATADIR/colors-$TERM ~/.le/colors-$TERM Color palette description. Those files are sequentially read and color definitions in later files have higher precision. ~/.le/keymap-$TERM DATADIR/keymap-$TERM ~/.le/keymap DATADIR/keymap Key map descriptions. Only the first existing file is read. ~/.le/term-$TERM DATADIR/term-$TERM Terminal specific options. Only the first existing file is read. Use Options->Terminal menu to tune the options. ./.le.ini ~/.le/le.ini DATADIR/le.ini Options. Only the first existing file is read. Use menu Options to tune these. .le.syntax ~/.le/syntax DATADIR/syntax Syntax highlighting rules. Only the first existing file is read. There is no default built-in in the editor, so if those files are not present you won't see any syntax highlighting. ~/.le/mainmenu DATADIR/mainmenu Main editor menu. It has simple text format. Only the first existing file is read. ~/.le/history Various histories are saved here. Do not edit by hand. DATADIR is determined at compile time by configure script (pkgdatadir variable). By default it has value /usr/local/share/le. AUTHOR
The LE editor was written by Alexander V. Lukyanov <lav@yars.free.net>. 28 Sep 2000 LE(1)
All times are GMT -4. The time now is 09:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy