Sponsored Content
Top Forums Shell Programming and Scripting Perl: Any quick way to use regex on hash keys? Post 302428428 by Leion on Thursday 10th of June 2010 01:40:52 AM
Old 06-10-2010
Here is the code...

Code:
 foreach $errBillkey(keys %hash)
 {
         if($errBillkey =~ m/^$account_no,.*/ )
        {
              // do something here
       }
}

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to set dynamically keys names in perl %hash

hello I have loop , in this loop im picking names , this names I want to be keys in %hash but I don't know how to set in every loop entertain different key in the %hash (1 Reply)
Discussion started by: umen
1 Replies

2. Shell Programming and Scripting

Quick regex question

Say that I want to match any of the following: abc def ghi The letters will either be "abc", "def", or "ghi", only those three patterns. The numbers will vary, but there will only be numbers between the brackets. I've only been able to match abc, using the following: abc.*. I'm... (1 Reply)
Discussion started by: retrovertigo
1 Replies

3. Shell Programming and Scripting

PERL - another quick hash of hashes question

Hi, sorry, two hash related questions in one day .. but this has got me a bit stuck. I have a mysql database table that kind of looks like this, the table is called "view1" and a snippet of that table (SELECT'ing just rows with serial number 0629AN1200) is below serial nic_name ... (2 Replies)
Discussion started by: hcclnoodles
2 Replies

4. Shell Programming and Scripting

Perl Hash:Can not keep hash data in the same order that it was inserted

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

5. Shell Programming and Scripting

perl hash - using a range as a hash key.

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

6. Shell Programming and Scripting

Sorting keys of a hash in perl

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

7. Programming

store information in hash and display number of keys.

I am trying to store this information (info and number) in hash. number is the key and info is value in a hash.i shown my code below. #!/usr/bin/perl use warnings; use strict; use XML::LibXML::Reader; my $file;open $file, 'formal.xml'); my $reader =... (0 Replies)
Discussion started by: veerubiji
0 Replies

8. Shell Programming and Scripting

Compare values of hashes of hash for n number of hash in perl without sorting.

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

9. Shell Programming and Scripting

Need regex for line not starting with hash #

I need to search for lines starting with "Include" and later has string "httpd-ssl.conf" like the regex should return match for "Include conf/extra/httpd-ssl.conf" I tried the following: ^]*#;].+Include.*httpd-ssl.conf Below is my current file: # Secure (SSL/TLS) connections... (7 Replies)
Discussion started by: mohtashims
7 Replies
MOKUTIL(1)						      General Commands Manual							MOKUTIL(1)

NAME
mokutil - utility to manipulate machine owner keys SYNOPSIS
mokutil [--list-enrolled] mokutil [--list-new] mokutil [--list-delete] mokutil [--import keylist| -i keylist] ([--hash-file hashfile | -f hashfile] | [--root-pw | -P] | [--simple-hash | -s]) mokutil [--delete keylist | -d keylist] ([--hash-file hashfile | -f hashfile] | [--root-pw | -P] | [--simple-hash | -s]) mokutil [--revoke-import] mokutil [--revoke-delete] mokutil [--export | -x] mokutil [--password | -p] ([--hash-file hashfile | -f hashfile] | [--root-pw | -P] | [--simple-hash | -s]) mokutil [--clear-password | -c] ([--simple-hash | -s]) mokutil [--disable-validation] mokutil [--enable-validation] mokutil [--sb-state] mokutil [--test-key | -t] ... mokutil [--reset] ([--hash-file hashfile | -f hashfile] | [--root-pw | -P] | [--simple-hash | -s]) mokutil [--generate-hash=password | -gpassword] DESCRIPTION
mokutil is a tool to import or delete the machines owner keys (MOK) stored in the database of shim. OPTIONS
--list-enrolled List the keys the already stored in the database --list-new List the keys to be enrolled --list-delete List the keys to be deleted --import Collect the followed files and form a request to shim. The files must be in DER format. --revoke-import Revoke the current import request (MokNew) --revoke-delete Revoke the current delete request (MokDel) --export Export the keys stored in MokListRT --password Setup the password for MokManager (MokPW) --clear-password Clear the password for MokManager (MokPW) --disable-validation Disable the validation process in shim --enrolled-validation Enable the validation process in shim --sb-state Show SecureBoot State --test-key Test if the key is enrolled or not --reset Reset MOK list --generate-hash Generate the password hash --hash-file Use the password hash from a specific file --root-pw Use the root password hash from /etc/shadow --simple-hash Use the old SHA256 password hash method to hash the password Note: --root-pw invalidates --simple-hash Thu Jul 25 2013 MOKUTIL(1)
All times are GMT -4. The time now is 10:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy