I am working on this idea that I want to process some information from a command dump.
Using the dump I will search for a string. If it finds the string, it must post a
different/associated string to output/logfile.
Example:
'Find "cookie jar"' then 'echo "carpool/tomorrow" > logfile'
It does not stop with 1 string to search for, it will have around 100 different
strings to search for, and everyone have some other content assigned to it, thus it
should be some clever loop.
I COULD have written one grep for each value, but since it is growing by the day,
I find that a waste of lines and bytes.
To prevent an infinite loop, it should remove what it has already found from the
sourcelist of what to search for or somehow mark it as processed.
(The sourcelist is overwritten each time the PC boots with an updated one)
The tricky bit for me is both how I can arrange it with a HASH table, I've done
something similar in PERL, but in BASH/AWK I am unable to do this. The system is very
limited and its not permitted toexpand on its available apps by any byte atm.
I've drawn out how I think the design is going to work.
In itself, there are several commands it will search the output for, but I am used to
having a launch script, that then uses a "core search" script with the variables that
designs it to that and that output file, predefined variables file and logfile.
It gives control and scalabillity ;-)
(The pink area is where the core script loops in itself to search for every available word)
Is this hard to acomplish?
I've written some BASH scripts in the past, aswell as some BATCH and PERL scripts,
though nothing close to this complexity.
I have a file with a format of
A,2
B,2
G,3
A,2
A,3
A,2
D,7
A,2
E,2
A,2
I need to create a sum of each alphabet with the numbers assigned to it using awk. (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)
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 am also a newbie in awk and trying to find solution of my problem.
I have one reference file 1.txt with 2 columns and I want to search other 10 files (a.txt, b.txt......h.txt each with 5 columns) corresponding to the values of 2nd column from 1.txt. If the value from 2nd column from 1.txt... (0 Replies)
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 DEBIAN
dump
dump(3tk)dump(3tk)NAME
dump - Dump information about Tcl interpreter in TkCon
SYNOPSIS
dump method ?-nocomplain? ?-filter pattern? ?--? pattern ?pattern ...?
DESCRIPTION
The dump command provides a way for the user to spit out state information about the interpreter in a Tcl readable (and human readable)
form. It takes the general form:
dump method ?-nocomplain? ?-filter pattern? ?--? pattern ?pattern ...?
The patterns represent glob-style patterns (as in string match pattern $str). -nocomplain will prevent dump from throwing an error if no
items matched the pattern. -filter is interpreted as appropriate for the method. The various methods are:
dump command args
Outputs one or more commands.
dump procedure args
Outputs one or more procs in sourceable form.
dump variable args
Outputs the values of variables in sourceable form. Recognizes nested arrays. The -filter pattern is used as to filter array ele-
ment names and is interepreted as a glob pattern (defaults to {*}). It is passed down for nested arrays.
dump widget args
Outputs one or more widgets by giving their configuration options. The -filter pattern is used as to filter the config options and
is interpreted as a case insensitive regexp pattern (defaults to {.*}).
SEE ALSO idebug(3tk), observe(3tk), tkcon(1), tkcon(3tk), tkconrc(5)KEYWORDS
Tk, console, dump
COPYRIGHT
Copyright (c) Jeffrey Hobbs <jeff at hobbs.org>
TkCon 2.5 dump(3tk)