I have a directory full of files (100 files) and I want to be able to search for a string called "end" at the end of the files (last line or last 5 lines) and echo each file to say "incomplete" if not found.
Im trying to execute application and its return code is below
IF Status code=o
echo "........"
else Staus Code =-2 DJRE
then echo "......"
Can any one help me how to handle the status code and echo some message. (12 Replies)
Hi,
I have a directory has DIR1 and the D1 directory has 200+ files.
I want change the string from "Bangalore" to "Bangaluru" in all files in the D1 directory.
Thanks (2 Replies)
Hello friends,
I have find a paticular string from the files present in my user
for example:
a username and password is hardcoded in multiple files which present in the my user.so I have to search about username in which files it is available.there are several dirctories are there,so... (5 Replies)
Hi,
I have a directory nsk,
files a.sql, b.sql, c.sql, d.sql,
assuming that I have line 'INSERT ALL INTO abc' in a.sql and c.sql
I need to list a filename, line number and complete line which contains ''INSERT ALL INTO abc' irrespective of case.
also in my files mentioned 'INSERT ALL... (4 Replies)
I came across and unexpected behavior with redirections in tcsh. I know, csh is not best for redirections, but I'd like to understand what is happening here.
I have following script (called out_to_streams.csh):
#!/bin/tcsh -f
echo Redirected to STDOUT > /dev/stdout
echo Redirected to... (2 Replies)
I have tried just about every find and grep command possible and I cannot find these damn files!!
This is the problem:
On the node you just swapped in, there are 5 JPEG files whose names contain the word "intro" in some form. Find all five files from on the entire disk (i.e. from root /).
... (2 Replies)
Hi All,
I need to write a script to find all "*.sh" files in /home file system and if any string find "*.sh" files with the name vijay@gmail.com need to replace with vijay.bhaskar@gmail.com. I just understood about the find the command to search .sh files. Please help me on this.
find / -name... (3 Replies)
Discussion started by: bhas85
3 Replies
LEARN ABOUT DEBIAN
file::find::rule::perl
File::Find::Rule::Perl(3pm) User Contributed Perl Documentation File::Find::Rule::Perl(3pm)NAME
File::Find::Rule::Perl - Common rules for searching for Perl things
SYNOPSIS
use File::Find::Rule ();
use File::Find::Rule::Perl ();
# Find all Perl files smaller than 10k
my @files = File::Find::Rule->perl_file
->size('<10Ki')
->in('dir');
# Locate all the modules that PAUSE will index
my @mod = File::Find::Rule->no_index
->perl_module
->in('My-Distribution');
DESCRIPTION
I write a lot of things that muck with Perl files. And it always annoyed me that finding "perl files" requires a moderately complex
File::Find::Rule pattern.
File::Find::Rule::Perl provides methods for finding various types Perl-related files, or replicating search queries run on a distribution
in various parts of the CPAN ecosystem.
METHODS
perl_module
The "perl_module" rule locates perl modules. That is, files that are named "*.pm".
This rule is equivalent to "->"file->name( '*.pm' )> and is included primarily for completeness.
perl_test
The "perl_test" rule locates perl test scripts. That is, files that are named "*.t".
This rule is equivalent to "->"file->name( '*.t' )> and is included primarily for completeness.
perl_installer
The "perl_installer" rule locates perl distribution installers. That is, it locates "Makefile.PL" and "Build.PL" files.
perl_script
The "perl_script" rule locates perl scripts.
This is any file that ends in .pl, or any files without extensions that have a perl "hash-bang" line.
perl_file
The "perl_file" rule locates all files containing Perl code.
This includes all the files matching the above "perl_module", "perl_test", "perl_installer" and "perl_script" rules.
no_index
# Provide the rules directly
$rule->no_index(
directory => [ 'inc', 't', 'examples' ],
file => [ 'Foo.pm', 'lib/Foo.pm' ],
);
# Provide a META.yml to use
$rule->no_index( 'META.yml' );
# Provide a dist root directory to look for a META.yml in
$rule->no_index( 'My-Distribution' );
# Automatically pick up a META.yml from the target directory
$rule->no_index->in( 'My-Distribution' );
The "no_index" method applies a set of rules as per the no_index section in a "META.yml" file.
SUPPORT
Bugs should always be submitted via the CPAN bug tracker
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Find-Rule-Perl <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Find-Rule-Perl>
For other issues, contact the maintainer
AUTHOR
Adam Kennedy <adamk@cpan.org>
SEE ALSO
<http://ali.as/>, File::Find::Rule, File::Find::Rule::PPI
COPYRIGHT
Copyright 2006 - 2011 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.12.4 2011-10-31 File::Find::Rule::Perl(3pm)