Sponsored Content
Top Forums Shell Programming and Scripting Modifying the values of dynamically named arrays Post 302635227 by Corona688 on Friday 4th of May 2012 12:11:56 PM
Old 05-04-2012
What's your system? What's your shell? And what are you actually trying to do, here? If you need to use eval to do something, you might have taken the wrong fork in the road somewhere, or might even be using the wrong programming language.

There's alternatives to arrays for instance. You can keep lists inside strings like "a b c d e" and split at need. Or in KSH, you can use associative arrays, and use entire strings as array indexes, letting you use one big array and avoiding the need for eval yet again.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Modifying binary file by editing Hex values ?

Hi , i'm using special binary file (lotus notes) and modifying an hexadecimal address range with windows hex editor and it works fine ! The file is an AIX one and i'm forced to transfert (ftp) it before modifying it and re-transfert ! NOW i would do this directly under AIX ! I can... (4 Replies)
Discussion started by: Nicol
4 Replies

2. Shell Programming and Scripting

Dynamically create arrays

I have a bash challenge. I have several virtualization hosts for which I need to collect VM information. I need to dynamically create an array for each host. The contents of the array should be the list VMs running on the host. Here's the logic; I just need someone to help me with the details:... (0 Replies)
Discussion started by: EdgarTorres
0 Replies

3. Shell Programming and Scripting

dynamically adding values in c-shell

I am needing to create a variable(changing) and assign it a value(changing) ... I am using C-Shell.. Example: foreach account in ($Accountlist) set account_connect = "$account/$account_pass" end I want to make set account_connect to store various values ? $account_connect did not... (3 Replies)
Discussion started by: shafi2all
3 Replies

4. Shell Programming and Scripting

Storing values in arrays using csh

I am reading a number of files but then I want to put the ranges xmin xmax ymin ymax as arrays for each file. Any idea how I can do this??? set j = 1 echo "Welcome $i times" while ( $j <= $i ) echo "$j" set fname = $fin-bst-misf.xy echo " "$fname ... (0 Replies)
Discussion started by: kristinu
0 Replies

5. Shell Programming and Scripting

Storing values in arrays

I have the following csh script which lets the use pass the following as an argument -legend=tag1/tag2/tag3/tag4/tag5/tag6/tag7 We pass a number of tags separated by '/'. I want to save the legend tags in an array and have done as below. How can I improve on this as things are getting quite... (3 Replies)
Discussion started by: kristinu
3 Replies

6. Shell Programming and Scripting

arrays and two values

I have requirement where I need to capture the highest values of items from a feed that runs for N hours. For example lets assume my data looks like this first feed ======== appples 10 oranges 20 pears 14 second feed ========== apples 5 oranges 30 pears 1 Last feed... (6 Replies)
Discussion started by: BeefStu
6 Replies

7. Programming

modifying 2 or more values using method in Java

i wanna make modification in two or more identifiers,using a method in JAVA , but the only way to do this is by returning a value ,then also only one variable value can be modified .. one way 2 do do this is by use of array and passing its name in method ,, please suggest a different way of doing... (2 Replies)
Discussion started by: upvan111
2 Replies

8. UNIX for Advanced & Expert Users

Retreving the dynamically allocated values from bdb using C

In one of the assignment which i am working on, i am am trying to insert keys and values into BDB by reading the input records from a input file as below. Here keys i am inserting as character buffer and for values i am dynamically allocating the memory using malloc and then inserting into bdb.... (1 Reply)
Discussion started by: AmbikaValagonda
1 Replies

9. Programming

Retreving the dynamically allocated values from bdb using C

In one of the assignment which i am working on, i am am trying to insert keys and values into BDB by reading the input records from a input file as below. Here keys i am inserting as character buffer and for values i am dynamically allocating the memory using malloc and then inserting into bdb.... (1 Reply)
Discussion started by: AmbikaValagonda
1 Replies

10. UNIX for Dummies Questions & Answers

Dynamically merging 2 files on header values

Hi All, I have 2 files which i need to merge together based on the column names provided in the file. The first line in both files are header records. The first file has fixed columns but second file can have subset of the columns from file 1 File 1: ... (6 Replies)
Discussion started by: kushagra
6 Replies
Font::TTF::Name(3pm)					User Contributed Perl Documentation				      Font::TTF::Name(3pm)

NAME
Font::TTF::Name - String table for a TTF font DESCRIPTION
Strings are held by number, platform, encoding and language. Strings are accessed as: $f->{'name'}{'strings'}[$number][$platform_id][$encoding_id]{$language_id} Notice that the language is held in an associative array due to its sparse nature on some platforms such as Microsoft ($pid = 3). Notice also that the array order is different from the stored array order (platform, encoding, language, number) to allow for easy manipulation of strings by number (which is what I guess most people will want to do). By default, $Font::TTF::Name::utf8 is set to 1, and strings will be stored as UTF8 wherever possible. The method "is_utf8" can be used to find out if a string in a particular platform and encoding will be returned as UTF8. Unicode strings are always converted if utf8 is requested. Otherwise, strings are stored according to platform: You now have to set <$Font::TTF::Name::utf8> to 0 to get the old behaviour. Apple Unicode (platform id = 0) Data is stored as network ordered UCS2. There is no encoding id for this platform but there are language ids as per Mac language ids. Mac (platform id = 1) Data is stored as 8-bit binary data, leaving the interpretation to the user according to encoding id. Unicode (platform id = 2) Currently stored as 16-bit network ordered UCS2. Upon release of Perl 5.005 this will change to utf8 assuming current UCS2 semantics for all encoding ids. Windows (platform id = 3) As per Unicode, the data is currently stored as 16-bit network ordered UCS2. Upon release of Perl 5.005 this will change to utf8 assuming current UCS2 semantics for all encoding ids. INSTANCE VARIABLES
strings An array of arrays, etc. METHODS
$t->read Reads all the names into memory $t->out($fh) Writes out all the strings $t->XML_element($context, $depth, $key, $value) Outputs the string element in nice XML (which is all the table really!) $t->XML_end($context, $tag, %attrs) Store strings in the right place is_utf8($pid, $eid) Returns whether a string of a given platform and encoding is going to be in UTF8 find_name($nid) Hunts down a name in all the standard places and returns the string and for an array context the pid, eid & lid as well set_name($nid, $str[, $lang[, @cover]]) Sets the given name id string to $str for all platforms and encodings that this module can handle. If $lang is set, it is interpretted as a language tag and if the particular language of a string is found to match, then that string is changed, otherwise no change occurs. If supplied, @cover should be a list of references to two-element arrays containing pid,eid pairs that should be added to the name table if not already present. This function does not add any names to the table unless @cover is supplied. Font::TTF::Name->match_lang($pid, $lid, $lang) Compares the language associated to the string of given platform and language with the given language tag. If the language matches the tag (i.e. is equal or more defined than the given language tag) returns true. This is calculated by finding whether the associated language tag starts with the given language tag. Font::TTF::Name->get_lang($pid, $lid) Returns the language tag associated with a particular platform and language id Font::TTF::Name->find_lang($pid, $lang) Looks up the language name and returns a lang id if one exists BUGS
o Unicode type strings will be stored in utf8 for all known platforms, once Perl 5.6 has been released and I can find all the mapping tables, etc. AUTHOR
Martin Hosken Martin_Hosken@sil.org. See Font::TTF::Font for copyright and licensing. perl v5.10.1 2010-10-28 Font::TTF::Name(3pm)
All times are GMT -4. The time now is 07:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy