06-05-2008
PERL Code
I have a code block ...
$cmd = "find $audit_dir -mtime +$days_to_keep -exec rm {} \\;";
unless(open(CMD, "$cmd |")){
$msg = "Error command : $cmd \n\n";
print_log $lgh,"$msg",1;
exit 1;
}
print_log $lgh, "Deleting physical files with Command : $cmd ", 1 if verbose;
while ($line=<CMD>) {
print_log $lgh, "Physical files older than $days_to_keep deleted from $audit_dir", 1 if $verbose;
}
after it executes the print_log , it's not going inside the while loop ..
what am I missing here ?
Thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Ok, I am thinking about developing a small little web app to help teach C to people. So you can type some C code into a text area, then a CGI Perl script or something similar would compile the code, then possibly execute it showing the results in another text area.
My concern of course is... (1 Reply)
Discussion started by: gdboling
1 Replies
2. UNIX for Dummies Questions & Answers
if anyone knows how to do the loop and the function listed, please let me know it would be a great help. Thanks!
•Create an array NUM with the following ten values in it:
14, 25.6, 43, 22, 412.14, 819, 2, 721, 7.218, 11.9
•Print the array NUM
•Create an array COLOR with the following... (1 Reply)
Discussion started by: circleW
1 Replies
3. Shell Programming and Scripting
I have 2 files , one is master file and another file i am genearting which contains Number of fails for all host & version.
The first file is master file which contains 2 column, Test Case name and Product Name:
daily/DB/attach/attach_redundancy.exp: YRS
daily/DB/help/help.exp: ... (0 Replies)
Discussion started by: getdpg
0 Replies
4. Shell Programming and Scripting
Is there a way to see or print a sub code?
Sometime a sub could be already defined, but in the debug mode (so, interactively) it could be already out of screen.
So, I would think about a way to check if the sub is defined (just 'defined' is not a problem) and how it is defined.
Also, if... (4 Replies)
Discussion started by: alex_5161
4 Replies
5. Programming
Hi,
plz see the below code , i have catch the file "Orders.20110714.out "file
as a Orders*.out. but it giving me an error .it does not open the file.
if the same thing i have done by code
code-> ls Orders*.out then it gives me the output
Orders.20110714.out
i am trying apply the... (1 Reply)
Discussion started by: pspriyanka
1 Replies
6. Shell Programming and Scripting
Hi
Please read the below information carefully and help me to solve the issue .
I want to know ,how to catch the word before perticular word using perl code??
Eg:
if the row contains
===========================
Original Order Tuple
Duplicatel Execution Tuple
... (1 Reply)
Discussion started by: pspriyanka
1 Replies
7. Shell Programming and Scripting
Perl code to get the diff of the two baselines in clearcase ? (2 Replies)
Discussion started by: saku
2 Replies
8. Shell Programming and Scripting
What is the meaning of below code, which is capturing from one file .
$runDate = $1 if $str =~ m/,"TransactTime":"({10})/; # get transaction date as run date
Is it the date from the first line of file or last line of file??? (Note:Each line from the file contains date) (2 Replies)
Discussion started by: aish11
2 Replies
9. Programming
Hi All,
I new to perl scripting, trying to write a program to get multiple inputs from the users and it should be stored in one variable. can some one help me with it .
here is the sample code i tried , but its not working.
# cat array.pl
#!/usr/bin/perl
print "enter the total no of... (4 Replies)
Discussion started by: nanduri
4 Replies
10. Shell Programming and Scripting
i'm using the below perl code to get a list of ips:
my @allipsfound ;
for my $elem (@gatches) {
my ($ip) = split ":",$elem;
print "$ip \n";
}
it spits out several lines of ips. most of those ips are the same. how do i do sort and uniq in the above code to make it so that it only... (3 Replies)
Discussion started by: SkySmart
3 Replies
LEARN ABOUT CENTOS
trace-cmd-extract
TRACE-CMD-EXTRACT(1) TRACE-CMD-EXTRACT(1)
NAME
trace-cmd-extract - extract out the data from the Ftrace Linux tracer.
SYNOPSIS
trace-cmd extract [OPTIONS]
DESCRIPTION
The trace-cmd(1) extract is usually used after trace-cmd-start(1) and trace-cmd-stop(1). It can be used after the Ftrace tracer has been
started manually through the Ftrace pseudo file system.
The extract command creates a trace.dat file that can be used by trace-cmd-report(1) to read from. It reads the kernel internal ring buffer
to produce the trace.dat file.
OPTIONS
-p plugin
Although extract does not start any traces, some of the plugins require just reading the output in ASCII format. These are the latency
tracers, since the latency tracers have a separate internal buffer. The plugin option is therefore only necessary for the wakeup,
wakeup-rt, irqsoff, preemptoff and preemptirqsoff plugins.
With out this option, the extract command will extract from the internal
Ftrace buffers.
-O option
If a latency tracer is being extracted, and the -p option is used, then there are some Ftrace options that can change the format. This
will update those options before extracting. To see the list of options see trace-cmd-list. To enable an option, write its name, to
disable the option append the characters no to it. For example: noprint-parent will disable the print-parent option that prints the
parent function in printing a function event.
-o outputfile
By default, the extract command will create a trace.dat file. This option will change where the file is written to.
SEE ALSO
trace-cmd(1), trace-cmd-record(1), trace-cmd-report(1), trace-cmd-start(1), trace-cmd-stop(1), trace-cmd-reset(1), trace-cmd-split(1),
trace-cmd-list(1), trace-cmd-listen(1)
AUTHOR
Written by Steven Rostedt, <rostedt@goodmis.org[1]>
RESOURCES
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
COPYING
Copyright (C) 2010 Red Hat, Inc. Free use of this software is granted under the terms of the GNU Public License (GPL).
NOTES
1. rostedt@goodmis.org
mailto:rostedt@goodmis.org
06/11/2014 TRACE-CMD-EXTRACT(1)