The bash utility on the current OS X (GNU bash, version 3.2.53(1)-release (x86_64-apple-darwin14)) does not support associative arrays. With a 1993 or later version of the Korn shell, you could try something like:
which could be invoked as:
to produce the output:
Hi,
I am trying to make an associative array to use in a popup_menu on a website. Here is what i have:
foreach $entr ( @entries )
{
$temp_uid = $entr->get_value(uid);
$temp_naam = $entr->get_value(sn);
$s++;
}
This is the popup_menu i want to use it in.
popup_menu(-name=>'modcon',... (4 Replies)
Hi,
When using sort on an associative array:
foreach $key (sort(keys(%opalfabet))){
$value = $opalfabet{$key};
$result .= $value;
}
How does it handle double values?
It seems to me that it removes them, is that true? If so, is there a way to get... (2 Replies)
Most shells flavors do not have associative arrays a.k.a. maps.
How would you emulate an associative array?
I had this problem once and found a working solution, but I don't want to spoil the game hence I wont tell it.
Wonder if anyone comes up with something better. (5 Replies)
i have a file like this
< '393200103052';'H3G';'20081204'
< '393200103059';'TIM';'20110111'
< '393200103061';'TIM';'20060206'
< '393200103064';'OPI';'20110623'
> '393200103052';'HKG';'20081204'
> '393200103056';'TIM';'20110111'
> '393200103088';'TIM';'20060206'
Now i have to generate a file... (9 Replies)
Hi All,
I got stuck up with shell script where i use awk. The scenario which i am working on is as below.
I have a file text.txt with contents
COL1 COL2 COL3 COL4
1 A 500 400
1 B 500 400
1 A 500 200
2 A 290 300
2 B 290 280
3 C 100 100
I could able to sum col 3 and col4 based on... (3 Replies)
I have an associative array named table
declare -A table
table="fruit"
table="veggie"
table="GT"
table="eminem"
Now say I have a variable returning the value highway
How do I find corresponding value GT ??
(this value that I find (GT in this case) is supposed to be the name of a mysql... (1 Reply)
Hi all
I have a problem where i have a large list ( up to 1000 of items) and need to have 2 items pulled from it into variables in a bash script
my list is like the following and I could have it as an array or possibly an external text file maintained separately. Every line is different and... (6 Replies)
Hello together,
i make something wrong... I want an array that contains information to associate it for further processing.
Here is something from my bash... You will know, what I'm trying to do.
I have to point out in advance, that the variable $SYSOS is changing and not as static as in my... (2 Replies)
I am trying to assign indexes to an associative array in a for loop but I have to use an eval command to make it work, this doesn't seem correct I don't have to do this with regular arrays
For example, the following assignment fails without the eval command:
#! /bin/bash
read -d "\0" -a... (19 Replies)
Hello.
I have an export of an associative array build using declare -p SOME_ARRAY_NAME > SOME_FILE_NAME.txt.
Producing some thing like declare -A SOME_ARRAY_NAME=( ="some_text" ="a_text" ......... ="another_text" ) in a text file.
I have a stock of functions which are sourced from... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT DEBIAN
cw
CW(7) Miscellaneous Information Manual CW(7)NAME
CW - the international Morse code
DESCRIPTION
CW is an abbreviation for "continuous wave", the commonly used technical term for Morse code communication. A basic knowledge or under-
standing of Morse code is a requirement for Radio Amateurs and Marine Radio Operators in many parts of the world.
MORSE CODE TIMINGS
In Morse code, a dot or dash is referred to as an element. The basic timing unit is the dot period. This is the time taken to send a dot,
not including any space before or after the dot. The lengths of all other elements are then derived from this basic unit, using the fol-
lowing rules:
The duration of a dash is three dots.
The time between each element (dot or dash) is one dot length.
The space between characters is three dot lengths.
The space between words is seven dot lengths.
The following formula calculates the dot period in microseconds from the Morse code speed in words per minute:
dot period = ( 1200000 / speed )
This formula arises from the use of the word PARIS as a 'standard' word for calibrating Morse code speed. PARIS is 50 units long when sent
in Morse code. Analysis of English plain-text indicates that the average word is 50 units, including spaces.
MORSE CODE CHARACTERS
The following list shows the IS0 8859-1 (Latin-1) characters that have commonly understood representations in Morse code:
ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"$()+-./:;=?_@ and space
In addition, following ISO 8859-1 and ISO 8859-2 accented characters are also part of the generally accepted international Morse code:
UACOEEANS (S with cedilla), (Z with caron/hacek),
Finally, libcw adds the following ASCII characters as extensions to single character procedural signals:
<>!&^~
MORSE CODE CHARACTER TABLES
The following table shows the Morse code equivalents for the ISO 8859-1, accented ISO 8859-1, and accented ISO 8859-2 characters above.
The ASCII portion of this table is taken from the ARRL Handbook, and the accented extensions from various other sources:
Ch Code Ch Code Ch Code Ch Code
-------------------------------------------------------
A .- B -... C -.-. D -..
E . F ..-. G --. H ....
I .. J .--- K -.- L .-..
M -- N -. O --- P .--.
Q --.- R .-. S ... T -
U ..- V ...- W .-- X -..-
Y -.-- Z --..
0 ----- 1 .---- 2 ..--- 3 ...--
4 ....- 5 ..... 6 -.... 7 --...
8 ---.. 9 ----.
" .-..-. ' .----. $ ...-..- ( -.--.
) -.--.- + .-.-. , --..-- - -....-
. .-.-.- / -..-. : ---... ; -.-.-.
= -...- ? ..--.. _ ..--.-
Ch Code Ch Code
-------------------------------------------------
U ..-- A .-.-
C -.-.. O ---.
E ..-.. A .-..-
A .--.- N --.--
S (S+cedilla) ---- (Z+caron/hacek) --..-
In addition to the above standard characters, the following characters are conventionally used for punctuation and procedural signals as
follows:
Ch Code Ch Code Ch Code Ch Code
-------------------------------------------------------
" .-..-. ' .----. $ ...-..- ( -.--.
) -.--.- + .-.-. , --..-- - -....-
. .-.-.- / -..-. : ---... ; -.-.-.
= -...- ? ..--.. _ ..--.- @ .--.-.
and the following are non-conventional extensions implemented by libcw:
Ch Code Ch Code Ch Code Ch Code
-----------------------------------------------------
< ...-.- > -...-.- ! ...-. & .-...
^ -.-.- ~ .-.-..
An alternative view of punctuation and procedural signals is as combination Morse characters:
Ch Prosig Ch Prosig Ch Prosig Ch Prosig
---------------------------------------------------------
" [AF] ' [WG] $ [SX] ( [KN]
) [KK] + [AR] , [MIM] - [DU]
. [AAA] / [DN] : [OS] ; [KR]
= [BT] ? [IMI] _ [IQ] @ [AC]
< [VA],[SK] > [BK] ! [SN] & [AS]
^ [KA] ~ [AL]
NOTES
Despite the fact that this manual page constantly and consistently refers to Morse code elements as dots and dashes, DO NOT think in these
terms when trying to learn Morse code. Always think of them as 'dit's and 'dah's.
SEE ALSO
Man pages for libcw(3,LOCAL), cw(1,LOCAL), cwgen(1,LOCAL), cwcp(1,LOCAL), and xcwcp(1,LOCAL).
CW Tutor Package CW(7)