09-16-2010
The perl code works for the example provide
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi everyone,
I need to know how to remove a chunk of codes from a file
for instance i have couple of lines which are commented out of the file and i need to remove that block. here is the example
--#------------------------------------------------------------------
--# File name= ... (5 Replies)
Discussion started by: ROOZ
5 Replies
2. Shell Programming and Scripting
Hi,
I do have a TAB delimted text file with the following format.
1 (- identifier of each group. this text is not present in the file only number)
1 3 4 65 56 WERTF
2 3 4 56 56 GHTYHU
3 3 5 64 23 VMFKLG
2
1 3 4 65 56 DGTEYDH
2 3 4 56 56 FJJJCKC
3 3 5 64 23 FNNNCHD
3
1 3 4 65 56 JDHJDH... (9 Replies)
Discussion started by: Lucky Ali
9 Replies
3. Shell Programming and Scripting
Hi all,
I have the following script, but are not too sure about the syntax to complete the script.
In essence, the script must connect to a SFTP server at a client site with username and password located in a file on my server.
Then change to the appropriate directory.
Pull the data to the... (1 Reply)
Discussion started by: codenjanod
1 Replies
4. Shell Programming and Scripting
Hi All
I wanted to know how to effectively delete some columns in a large tab delimited file.
I have a file that contains 5 columns and almost 100,000 rows
3456 f g t t
3456 g h
456 f h
4567 f g h z
345 f g
567 h j k lThis is a very large data file and tab delimited.
I need... (2 Replies)
Discussion started by: Lucky Ali
2 Replies
5. Shell Programming and Scripting
Hi All,
I need some help to effectively parse out a subset of results from a big results file.
Below is an example of the text file. Each block that I need to parse starts with "Output of GENE for sequence file 100.fasta" (next block starts with another number). I have given the portion of... (8 Replies)
Discussion started by: Lucky Ali
8 Replies
6. Shell Programming and Scripting
Hi Gurus,
I need some help in extracting some of these information and massage it into the desired output as shown below.
I need to extract the last row with the header in below sample which is usually the most recent date, for example:
2012-06-01 142356 mb 519 -219406 mb 1 ... (9 Replies)
Discussion started by: superHonda123
9 Replies
7. UNIX for Advanced & Expert Users
Hi ,
I am getting file name like
ABC_DATA_CUSTIOMERS_20120617.dat
ABC_DATA_PRODUCTS_20120617.dat
Need to convert
CUSTIOMERS.dat
PRODUCTS.dat
Help me how to do this. (7 Replies)
Discussion started by: reach_malu
7 Replies
8. Shell Programming and Scripting
Need to sort a portion of a file in a Alphabetical Order.
Example : The user adam is not sorted and the user should get sorted. I don't want the complete file to get sorted.
Currently All_users.txt contains the following lines.
##############
# ARS USERS
##############
mike, Mike... (6 Replies)
Discussion started by: evrurs
6 Replies
9. Shell Programming and Scripting
I am trying to parse a file but the filehas binary data inline mixed with text fields.
I tried the binutils strings function , it get the binary data out but put the char following the binary data in a new line .
input file
app_id:1936 pgm_num:0 branch:TBNY ord_num:0500012(–QMK) deal_num:0... (12 Replies)
Discussion started by: tasmac
12 Replies
10. Shell Programming and Scripting
Hi,
I have a log file that gets updated every second. Currently the size has grown to 20+ GB. I need to have a command/script, that will try to get the actual size of the file and will remove 50% of the data that are in the log file. I don't mind removing the data as the size has grown to huge... (8 Replies)
Discussion started by: Souvik Patra
8 Replies
LEARN ABOUT CENTOS
mail::spamassassin::timeout
Mail::SpamAssassin::Timeout(3) User Contributed Perl Documentation Mail::SpamAssassin::Timeout(3)
NAME
Mail::SpamAssassin::Timeout - safe, reliable timeouts in perl
SYNOPSIS
# non-timeout code...
my $t = Mail::SpamAssassin::Timeout->new({ secs => 5, deadline => $when });
$t->run(sub {
# code to run with a 5-second timeout...
});
if ($t->timed_out()) {
# do something...
}
# more non-timeout code...
DESCRIPTION
This module provides a safe, reliable and clean API to provide alarm(2)-based timeouts for perl code.
Note that $SIG{ALRM} is used to provide the timeout, so this will not interrupt out-of-control regular expression matches.
Nested timeouts are supported.
PUBLIC METHODS
my $t = Mail::SpamAssassin::Timeout->new({ ... options ... });
Constructor. Options include:
secs => $seconds
time interval, in seconds. Optional; if neither "secs" nor "deadline" is specified, no timeouts will be applied.
deadline => $unix_timestamp
Unix timestamp (seconds since epoch) when a timeout is reached in the latest. Optional; if neither secs nor deadline is specified,
no timeouts will be applied. If both are specified, the shorter interval of the two prevails.
$t->run($coderef)
Run a code reference within the currently-defined timeout.
The timeout is as defined by the secs and deadline parameters to the constructor.
Returns whatever the subroutine returns, or "undef" on timeout. If the timer times out, "$t-<gt"timed_out()> will return 1.
Time elapsed is not cumulative; multiple runs of "run" will restart the timeout from scratch. On the other hand, nested timers do
observe outer timeouts if they are shorter, resignalling a timeout to the level which established them, i.e. code running under an
inner timer can not exceed the time limit established by an outer timer. When restarting an outer timer on return, elapsed time of a
running code is taken into account.
$t->run_and_catch($coderef)
Run a code reference, as per "$t-<gt"run()>, but also catching any "die()" calls within the code reference.
Returns "undef" if no "die()" call was executed and $@ was unset, or the value of $@ if it was set. (The timeout event doesn't count
as a "die()".)
$t->timed_out()
Returns 1 if the most recent code executed in "run()" timed out, or "undef" if it did not.
$t->reset()
If called within a "run()" code reference, causes the current alarm timer to be restored to its original setting (useful after our
alarm setting was clobbered by some underlying module).
perl v5.16.3 2011-06-06 Mail::SpamAssassin::Timeout(3)