10-20-2010
Dear Cabrao,
Sorry this deosn't work for me. The result does not match with the number of files that I should delete.
Thanks anyway for your help.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
My apache logs are saved in the following format (using rotatelogs):
Oct 8 01:59 access_log.1002412800
Oct 9 01:55 access_log.1002499200
Oct 10 01:58 access_log.1002585600
Oct 11 01:56 access_log.1002672000
Oct 12 01:59 access_log.1002758400
I would like to run a cronjob once a week to... (2 Replies)
Discussion started by: jamesbond
2 Replies
2. UNIX for Dummies Questions & Answers
Hi,
Can anyone help me delete old files in a directory? Let's say, I want to delete all files which are 365 days old. Thank you. (2 Replies)
Discussion started by: risk_sly
2 Replies
3. Solaris
Hi All,
I am wondering whether is there a way to remove files according to date. For example, I have 500 files between Jan - April, and I want to remove files created only on March.
Is there any way to do this?
Thanks in advanced.
rgds,
Ronny (2 Replies)
Discussion started by: ronny_nch
2 Replies
4. Shell Programming and Scripting
we have files created by Aug12 and Feb 23 and Mar10
i want to delete the files which has created on Mar 10
Kindly let me know the script to delete the files which is created by Mar 10 (4 Replies)
Discussion started by: venikathir
4 Replies
5. Shell Programming and Scripting
Hi Guys,
I need help on deleting particular date files in a directory. I have to delete thousands of files with respect to particular date. Could anyone help on this to delete particular date files at a time?
Thanks in Advance (2 Replies)
Discussion started by: teddy2882
2 Replies
6. UNIX Desktop Questions & Answers
Guys, I am wondering how to remove files for a specific date in a directory?
for instance when I do ls -l , i see many files. And i want to delete files for date May 15:
58252015 May 10 03:45 my_05102012.log
58252015 May 15 06:45 my_05152012.log
Thanks (8 Replies)
Discussion started by: DallasT
8 Replies
7. Shell Programming and Scripting
To delete log files content older than 30 days and append the lastest date log file date in the respective logs
I want to write a shell script that deletes all log files content older than 30 days and append the lastest log file date in the respective logs
This is my script
cd... (2 Replies)
Discussion started by: sreekumarhari
2 Replies
8. UNIX for Dummies Questions & Answers
dear all,
i m a newbie and i want to delete all files of a particular date,how can i do this? your help appreciated,thanks in advance.
OS:RHEL 6 (5 Replies)
Discussion started by: mdabdul
5 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I need a command for deleting all the compress files *.Z that are older than the current date - 5 days. Basically I have a directory where daily I meet some back up files and I want to remove automatically the ones 5 days (or more) older than the current date. How can I write a 'rm' command... (1 Reply)
Discussion started by: Francy
1 Replies
10. UNIX for Dummies Questions & Answers
I'm quite new to Unix but I want to delete some old backup files stored in a directory.
the backups are stored on a network storage device located at /mnt/terastation12/backup. I want to delete everything upto one month ago. would the following command in Unix Sun do that?
find... (5 Replies)
Discussion started by: dbajtr
5 Replies
LEARN ABOUT DEBIAN
class::makemethods::utility::textbuilder
MakeMethods::Utility::TextBuilder(3pm) User Contributed Perl Documentation MakeMethods::Utility::TextBuilder(3pm)
NAME
Class::MakeMethods::Utility::TextBuilder - Basic text substitutions
SYNOPSIS
print text_builder( $base_text, @exprs )
DESCRIPTION
This module provides a single function, which implements a simple "text macro" mechanism for assembling templated text strings.
$expanded_text = text_builder( $base_text, @exprs )
Returns a modified copy of $base_text using rules from the @exprs list.
The @exprs list may contain any of the following:
o A string, in which any '*' characters will be replaced by the base text. The interpolated string then replaces the base text.
o A code-ref, which will be called with the base text as its only argument. The result of that call then replaces the base text.
o A hash-ref, which will be added to the substitution hash used in the second pass, below.
o An array-ref, containing additional expressions to be treated as above.
After any initial string and code-ref rules have been applied, the hash of substitution rules are applied.
The text will be searched for occurances of the keys of the substitution hash, which will be modified based on the corresponding value in
the hash. If the substitution key ends with '{}', the search will also match a balanced block of braces, and that value will also be used
in the substitution.
The hash-ref may contain the following types of rules:
o 'string' => 'string'
Occurances of the first string are to be replaced by the second.
o 'string' => code_ref
Occurances of the string are to be replaced by the results of calling the subroutine with no arguments.
o 'string{}' => 'string'
Occurances of the first string and subsequent block of braces are replaced by a copy of the second string in which any '*' characters
have first been replaced by the contents of the brace block.
o 'string{}' => code_ref
Occurances of the string and subsequent block of braces are replaced by the results of calling the subroutine with the contents of the
brace block as its only argument.
o 'string{}' => hash_ref
Occurances of the string and subsequent block of braces are replaced by using the contents of the brace block as a key into the
provided hash-ref.
EXAMPLE
The following text and modification rules provides a skeleton for a collection letter:
my $letter = "You owe us AMOUNT. Please pay up!
" .
"THREAT{SEVERITY}";
my @exprs = (
"Dear NAMEm
*",
"*
-- The Management",
{ 'THREAT{}' => { 'good'=>'Please?', 'bad'=>'Or else!' } },
" DATE
*",
{ 'DATE' => 'Tuesday, April 1, 2001' },
);
One might invoke this template by providing additional data for a given instance and calling the text_builder function:
my $item = { 'NAME'=>'John', 'AMOUNT'=>'200 camels', 'SEVERITY'=>'bad' };
print text_builder( $letter, @exprs, $item );
The resulting output is shown below:
Tuesday, April 1, 2001
Dear John,
You owe us 200 camels. Please pay up!
Or else!
-- The Management
SEE ALSO
See Class::MakeMethods for general information about this distribution.
perl v5.10.1 2004-09-06 MakeMethods::Utility::TextBuilder(3pm)