Trying to use the find command to find any directory which contains a file ending in .zip AND a file ending in .o
I'm having trouble specifying multiple files as criteria and have can't seem to figure it out from Unix in a Nutshell and Google. (2 Replies)
Dear All
I am basic user of Unix.
i woul like to delete some files
(basically 05 and 0801111105) from unix directories but unable to delete it
I tried all option. rm , rm -f etc.. but not succeed.
Infact it also not allowing me to use chmod option so that i can grant 777 option to... (1 Reply)
Hi ppl.
I have to check for duplicate files in a directory .
the directory has following files
/the/folder /containing/the/file
a1.yyyymmddhhmmss
a1.yyyyMMddhhmmss
b1.yyyymmddhhmmss
b2.yyyymmddhhmmss
c.yyyymmddhhmmss
d.yyyymmddhhmmss
d.yyyymmddhhmmss
where the date time stamp can be... (1 Reply)
Hello
I'm new to this forum, so I did a quick scan of the FAQs to see if my problem had been addressed already, since I believe it is probably a very common need. I was surprised that I did not see anything obvious.
I need to remove all files from a directory that have a last modified date... (2 Replies)
Hi
I have a problem. One of the directories in /var, on one of my servers, has filled up with loads of files. I have tried to list the directory to see what is in it, but the 'ls' command just hangs. Same thing happens when I try to use 'rm' to remove files from that directory.
I can see what... (2 Replies)
Hi all,
I have the following question. Considder that in the directory /code the script remove.pl exists. What i want is to run this script and remove some files that exist in the directory /dir/tmp. I use the below code but it does not work.
system("cd /dir/code");
system("rm FileName");
... (6 Replies)
I'm trying to remove several directories which contains sun-dirs and files inside.
I used the command rm -r <dirname>
But, it always ask "examine file in directory <dirname> yes/no?" line by line.
So, i need to write "y" for every line.
How can i skip this step and remove all directories with... (9 Replies)
I have some empty files that were created from a script I ran that I cannot delete using the rm command.... any ideas as how I can delete them?
-rw-r--r-- 1 schroeks x_exp 0 Jul 21 08:24 rrd15CEC
-rw-r--r-- 1 schroeks x_exp 0 Jul 21 11:37 rrd15CEC
-rw-r--r-- ... (20 Replies)
Hello,
I have several thousand files with different extensions in a directory. Is there a single command to get what the various extensions are with a single command.
Thanks for your help!
Best,
Guss (2 Replies)
Hi all.
Am doing continuous backup of mailboxes using rsync.
So whenever a new mail arrives it is automatically copied on backup server.
When a new mail arrives it is named as xyz:2, when it is read by the email client an S is appended xyz:2,S
Eventually , 2 copies of the same file exist on... (7 Replies)
Discussion started by: coolatt
7 Replies
LEARN ABOUT DEBIAN
any::template::processdir
Any::Template::ProcessDir(3pm) User Contributed Perl Documentation Any::Template::ProcessDir(3pm)NAME
Any::Template::ProcessDir -- Process a directory of templates
VERSION
version 0.07
SYNOPSIS
use Any::Template::ProcessDir;
# Process templates and generate result files in a single directory
#
my $pd = Any::Template::ProcessDir->new(
dir => '/path/to/dir',
process_text => sub {
my $template = Any::Template->new( Backend => '...', String => $_[0] );
$template->process({ ... });
}
);
$pd->process_dir();
# Process templates and generate result files to a separate directory
#
my $pd = Any::Template::ProcessDir->new(
source_dir => '/path/to/source/dir',
dest_dir => '/path/to/dest/dir',
process_file => sub {
my $file = $_[0];
# do something with $file, return content
}
);
$pd->process_dir();
DESCRIPTION
Recursively processes a directory of templates, generating a set of result files in the same directory or in a parallel directory. Each
file in the source directory may be template-processed, copied, or ignored depending on its pathname.
CONSTRUCTOR
Specifying directory/directories
o If you want to generate the result files in the same directory as the templates, just specify dir.
my $pd = Any::Template::ProcessDir->new(
dir => '/path/to/dir',
...
);
o If you want to generate the result files in a separate directory from the templates, specify source_dir and dest_dir.
my $pd = Any::Template::ProcessDir->new(
source_dir => '/path/to/source/dir',
source_dir => '/path/to/dest/dir',
...
);
Specifying how to process templates
process_file
A code reference that takes the full template filename and the "Any::Template::ProcessDir" object as arguments, and returns the result
string. This can use Any::Template or another method altogether. By default it calls "process_text" on the contents of the file.
process_text
A code reference that takes the template text and the "Any::Template::ProcessDir" object as arguments, and returns the result string.
This can use Any::Template or another method altogether.
Optional parameters
dir_create_mode
Permissions mode to use when creating destination directories. Defaults to 0775. No effect if you are using a single directory.
file_create_mode
Permissions mode to use when creating destination files. Defaults to 0444 (read-only), so that destination files are not accidentally
edited.
ignore_files
Coderef which takes a full pathname and returns true if the file should be ignored. By default, all files will be considered.
readme_filename
Name of a README file to generate in the destination directory - defaults to "README". No file will be generated if you pass undef or
if you are using a single directory.
template_file_suffix
Suffix of template files in source directory. Defaults to ".src". This will be removed from the destination file name.
Any file in the source directory that does not have this suffix (or "ignore_file_suffix") will simply be copied to the destination.
METHODS
process_dir
Process the directory. If using multiple directories, the destination directory will be removed completely and recreated, to eliminate
any old files from previous processing.
SEE ALSO
Any::Template
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Jonathan Swartz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-05-14 Any::Template::ProcessDir(3pm)