If a declare a direct hash , then the hash element works fine.
Code:
my %test = ("test",1);
print %test;
print "\n";
Here in the above, the name of the hash is predeclared...
Suppose now I need to create the hash elements dynamically in the for loop.
Code:
$test="hash";
my ${$test}=("test",1); ## assuming $test will be replaced by hash
But receiving an error message as below..
an't declare scalar dereference in "my" at hashtest.pl line 3, near "}="
xecution of hashtest.pl aborted due to compilation errors.
I have a requirement in which I need to create the hash elements in the loop based on some variables in array and I'm using "use strict" and "use warning pragmas" .
Could anyone please let me know how to create hash variables from the elements of array?
Thanks in advance ....
Last edited by scriptscript; 09-06-2013 at 08:41 AM..
Hello all,
I am trying to delete all the lines in a particular file having a pattern. The problem is that it has special characters and for some reason is not doing the job.
For eg.
src_file
/home/test/filelist.txt :xxxx:ogog
/home/test/RCH/ogogogg
/home/test/RYHUJ/HHHH... (3 Replies)
Good day, everyone!
Could anybody explain me the following situation.
If I'm running similar script:
Var="anna.kurnikova"
Var2="Anna Kurn"
echo $Var | tr -t "$Var" "$Var2"
Why the output is :
anna KurniKova
instead of Anna Kurnikova?
:confused:
Thank you in advance for any... (2 Replies)
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)
Hello,
I have a hash in hsh. I need to assign it to another hash globalHsh. I think the below statement does not work
$globalHsh{$id} = %hsh;
What is the right way to assign it?
Thanks (3 Replies)
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)
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)
Hello All,
I have a problem in counting number of process getting run with my current script name..
Here it is
ps -ef | grep $0 | grep -v grep
This display just one line with the PID, PPID and other details when i print it in the script.
But when I want to count the numbers in my... (11 Replies)
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)
Hi, I have a hash of hash where it has
name, activities and count
i have data like this -
$result->{$name}->{$activities} = $value;
content of that are -
name - robert tom cat peter
activities - running, eating, sleeping , drinking, work
i need to print output as below
... (3 Replies)
Discussion started by: asak
3 Replies
LEARN ABOUT CENTOS
mokutil
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)