02-29-2012
Yes, my expected output is a list of unique userid per each group.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Shell Programming and Scripting
Can Someone explain me why even using Tie::IxHash I can not get the output data in the same order that it was inserted? See code below.
#!/usr/bin/perl
use warnings;
use Tie::IxHash;
use strict;
tie (my %programs, "Tie::IxHash");
while (my $line = <DATA>) {
chomp $line;
my(... (1 Reply)
Discussion started by: jgfcoimbra
1 Replies
3. Shell Programming and Scripting
Hi,
In Perl, is it possible to use a range of numbers with '..' as a key in a hash?
Something in like:
%hash = (
'768..1536' => '1G',
'1537..2560' => '2G'
);
That is, the range operation is evaluated, and all members of the range are... (3 Replies)
Discussion started by: dsw
3 Replies
4. Shell Programming and Scripting
hi all,
i have a small problem regarding sorting the keys in a hash.
my %hash;
for($i=0;$i<19;$i++)
{
$hash{$i}=$i;
}
foreach $c (sort keys %hash)
{
print "\n $hash{$c}";
} (1 Reply)
Discussion started by: niteesh_!7
1 Replies
5. Shell Programming and Scripting
Hi,
I have a datahash with 'n' number of values in perl script. I am writing a xml file from the datahash. I am getting output with sorting(Field sorting). My question is that i don't want any default sorting.whatever i am inserting into datahash it should give same xml file.
Any help?
... (0 Replies)
Discussion started by: solo123
0 Replies
6. Shell Programming and Scripting
Hi All
I've got a perl script that I'm having a problem with when it prints the output of a hash. Some background. I'm trying to merge two file with a similar structure but with different data. Here is a portion of the script I'm using.
while (<INPUT>) {
my... (0 Replies)
Discussion started by: kingpin2502
0 Replies
7. Shell Programming and Scripting
Hi ,
i have the below code its working fine when i execute in unix , but its not working in windows could you pls explain me where i am going wrong.
This is the program
$data = { '1' => 'one' ,
'2' => 'two' ,
3 => 'three'
};
print "hello : $data->{'1'}... (2 Replies)
Discussion started by: ragilla
2 Replies
8. Shell Programming and Scripting
I want to sort values of a hash in ascending order.
my %records;
for my $value (sort values %records){print $value,"\n";}
When I use the above code I get values in this order: 1,10,11,2,3,4,5,6,7,8,9. But, I need values in my output in this order: 1,2,3,4,5,6,7,8,9,10,11.
Can Someone... (1 Reply)
Discussion started by: koneru_18
1 Replies
9. Shell Programming and Scripting
Hi,
I have an hashes of hash, where hash is dynamic, it can be n number of hash. i need to compare data_count values of all .
my %result (
$abc => {
'data_count' => '10',
'ID' => 'ABC122',
}
$def => {
'data_count' => '20',
'ID' => 'defASe',
... (1 Reply)
Discussion started by: asak
1 Replies
10. Programming
My issue is that the perl script (as I have done it so far) created empty branches when I try to check some branches on existence.
I am using multydimentional hashes: found it as the best way for information that I need to handle. Saing multidimentional I means hash of hashes ... So, I have
... (2 Replies)
Discussion started by: alex_5161
2 Replies
LEARN ABOUT DEBIAN
lfc_getidmap
LFC_GETIDMAP(3) LFC Library Functions LFC_GETIDMAP(3)
NAME
lfc_getidmap - get virtual uid/gid(s) associated with a given dn/role(s)
SYNOPSIS
#include <sys/types.h>
#include "lfc_api.h"
int lfc_getidmap (const char *username, int nbgroups, const char **groupnames, uid_t *userid, gid_t *gids)
int lfc_getidmapc (const char *username, const char *user_ca, int nbgroups, const char **groupnames, uid_t *userid, gid_t *gids)
DESCRIPTION
lfc_getidmap gets the virtual uid/gid(s) associated with a given dn/role(s). If the dn or any of the roles does not exist yet in the Data-
base an entry is added to the mapping table.
username
specifies the user name (dn). It must be at most 255 characters long.
user_ca
specifies the CA from the user proxy. It must be at most 255 characters long.
nbgroups
is the number of group names.
groupnames
is the address of an array of group names (vo/role). Each group name must be at most 255 characters long. This pointer can be
NULL. In this case the vo is obtained from a static mapping file.
userid specifies the address of a buffer to receive the Virtual User Id.
gids specifies the address of a buffer to receive the Virtual Group Ids. It must be big enough to receive nbgroups group ids, but at
least one group id in case nbgroups is zero.
RETURN VALUE
This routine returns 0 if the operation was successful or -1 if the operation failed. In the latter case, serrno is set appropriately.
ERRORS
ENOMEM Memory could not be allocated in the server to receive the group names or to send back the gids.
EACCES One of username, user_ca or the primary (first) group is banned.
EFAULT username, userid or gids is a NULL pointer.
EINVAL nbgroups is negative or the length of username, user_ca or of one of the group names exceeds 255.
SENOSHOST Host unknown.
SENOSSERV Service unknown.
SECOMERR Communication error.
SENOMAPFND DISABLEAUTOVIDS is set and username or one of the groups does not exist.
ENSNACT Name server is not running or is being shutdown.
LFC
$Date: 2010-08-04 09:58:47 +0200 (Wed, 04 Aug 2010) $ LFC_GETIDMAP(3)