Sponsored Content
Full Discussion: list of hashes
Top Forums Shell Programming and Scripting list of hashes Post 302475314 by new bie on Sunday 28th of November 2010 12:41:37 AM
Old 11-28-2010
Thanks for replying k_manimuthu, I've tried the script you suggested and it worked fine. However, it only print out the newest key/value pairs of repeated pairs. I'd like to print all key/value pairs of repeated pairs. And sorry, I wasn't clear in original post.

I'll try to work on your code and see if I can get it the way I need. If you have any suggestion, please help me out.

thanks a lot,

new bie,

Last edited by new bie; 11-28-2010 at 01:44 AM.. Reason: clarification
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl: hashes, whiles, and last

hello everyone, i am creating 2 hashes from 2 different files, then looking for the value of one in the value of the other to make a new file. for example: file1: DENV => Denver file2: H224-0A-12 => DENVER if Denver is found in DENVER (case insensitive), a new hash now contains H224-0A-12... (0 Replies)
Discussion started by: effigy
0 Replies

2. Shell Programming and Scripting

How To Sort Array of Hashes ??

Some one plz help me how to sort an array of hashes ..... for e.g i have an array as @AoH = ( { ques => 10, marks => 32, }, { ques => 32, marks => 22, }, { ques => 2, marks => 41, }, ); now i want to sort this array with increasing value of "ques" ..... plz... (3 Replies)
Discussion started by: coolguyshail
3 Replies

3. Shell Programming and Scripting

perl hashes question

hi guys im running into a problem here this is my script #!/usr/bin/perl use CGI qw(:standard); $header = "MIME-Version: 1.0\n"; $header .= "Content-type: text/html\n"; $header .= "\n"; #get the point parameter from nhl.html $Team = param("points"); print "$header"; open(INFILE,... (1 Reply)
Discussion started by: lucho_1
1 Replies

4. Shell Programming and Scripting

Print Entire hash list (hash of hashes)

I have a script with dynamic hash of hashes , and I want to print the entire hash (with all other hashes). Itried to do it recursively by checking if the current key is a hash and if yes call the current function again with refference to the sub hash. Most of the printing seems to be OK but in... (1 Reply)
Discussion started by: Alalush
1 Replies

5. UNIX for Dummies Questions & Answers

Name in hashes(####)???

Hey frens someone pls temme what i need to do so that after I logged into my unix terminal i should get my name written in hashes(i.e ###) Hope someone ll help me out.... (2 Replies)
Discussion started by: smarty86
2 Replies

6. Shell Programming and Scripting

Hashes help in Perl

Hi, I am stuck at this problem where part of my code would store all the websites that has been accessed by a user. I pull these values from a log file. I want to create a HASH of HASHES ? (Please correct me if this is not the right approach) where I would store all the hits to website with... (4 Replies)
Discussion started by: Dabheeruz
4 Replies

7. Shell Programming and Scripting

perl hash of hashes from database

hi there, I have some database output that looks like this SELECT nic_name,nic_duplex,nic_speed,nic_ip FROM network_table WHERE hostname = "server1" result is this (ive delimited with a pipe for ease of reading) bge0|full|1000|10.32.100.1 bge1|full|1000|11.12.101.7 ... (1 Reply)
Discussion started by: hcclnoodles
1 Replies

8. Shell Programming and Scripting

Creating Hashes of Hashes of Array

Hi folks, I have a structure as mentioned below in a configuration file. <Component> Comp1: { item1:data,someUniqueAttribute; item2:data,someUniqueAttribute, } Comp2: { item3:data,someUniqueAttribute; ... (1 Reply)
Discussion started by: ckv84
1 Replies

9. Shell Programming and Scripting

perl: dereferencing a hash of hashes

Hi there, I am trying to dereference my hash of hashes but post dereferencing, it seems to lose its structure I am using Data::dumper to help me anaylise. This is the code im using to build the HoH, (data comes from a file). I have also performed a Dumper on the data structure before and after... (1 Reply)
Discussion started by: rethink
1 Replies

10. Shell Programming and Scripting

Perl : array of hashes help

Hi, I have array of hashes and each key has array like below. @array1 = ( { 'url' => , 'bill' => }, { 'url' => , 'bill' => }, { 'url' => , ... (0 Replies)
Discussion started by: ragilla
0 Replies
wsreg_set_data(3WSREG)				    Product Install Registry Library Functions				    wsreg_set_data(3WSREG)

NAME
wsreg_set_data, wsreg_get_data, wsreg_get_data_pairs - add or retrieve a key-value pair SYNOPSIS
cc [flag ...] file ...-lwsreg [library ...] #include <wsreg.h> int wsreg_set_data(Wsreg_component *comp, const char *key, const char *value); char *wsreg_get_data(const Wsreg_component *comp, const char *key); char *wsreg_get_data_pairs(const Wsreg_component *comp); DESCRIPTION
The wsreg_set_data() function adds the key-value pair specified by key and value to the component specified by comp. If value is NULL, the key and current value is removed from the specified component. The wsreg_get_data() function retrieves the value associated with the key specified by key from the component specified by comp. The wsreg_get_data_pairs() function returns the list of key-value pairs from the component specified by comp. RETURN VALUES
The wsreg_set_data() function returns a non-zero value if the specified key-value pair was successfully added. It returns 0 if the addi- tion failed. If NULL is passed as the value, the current key-value pair are removed from the specified component. The wsreg_get_data() function returns the value associated with the specified key. It returns NULL if there is no value associated with the specified key. The char pointer that is returned is not a clone, so it must not be freed by the caller. The wsreg_get_data_pairs() function returns a null-terminated array of char pointers that represents the specified component's list of data pairs. The even indexes of the resulting array represent the key names. The odd indexes of the array represent the values. If the speci- fied component has no data pairs, NULL is returned. The resulting array (not its contents) must be released by the caller. USAGE
Any string data can be associated with a component. Because this information can be viewed in the prodreg registry viewer, it is a good place to store support contact information. After the data pairs are added or removed, the component must be updated with a call to wsreg_register(3WSREG) for the modifications to be persistent. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
prodreg(1M), wsreg_initialize(3WSREG), wsreg_register(3WSREG), attributes(5) SunOS 5.10 22 Sep 2000 wsreg_set_data(3WSREG)
All times are GMT -4. The time now is 12:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy