07-19-2006
why do you need the while loop
simply find <dir> -name <filename>|xargs grep -l -e <pattern> -e <pattern>
should give you the desired results
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello experts,
I run Solaris 9. I have a below script which is used for gunzip the thousand files from a directory.
----
#!/usr/bin/sh
cd /home/thousands/gzipfiles/
for i in `ls -1`
do
gunzip -c $i > /path/to/file/$i
done
----
In my SAME directory there thousand of GZIP file and also... (4 Replies)
Discussion started by: thepurple
4 Replies
2. Shell Programming and Scripting
Dear other forum members,
I'm writing a script for my homework, but I'm scratching all over my head and still can't figure out what I did wrong. Please help me. I just started to learn about bash scripting, and I appreciate if anyone of you can point out my errors. I thank you in advance.
... (3 Replies)
Discussion started by: ilove2smoke
3 Replies
3. Shell Programming and Scripting
Hey everyone,
I'm trying get a list of files using but also append some data located inside the file.
The log files contain two strings that I am trying to extract. These strings are surrounded by tags.
Here is a sample log file:
... (2 Replies)
Discussion started by: ToeLint
2 Replies
4. Shell Programming and Scripting
Hello everyone!
I have 2 types of files in the following format:
1) *.fa
>1234
...some text...
>2345
...some text...
>3456
...some text...
.
.
.
.
2) *.info
>1234 (7 Replies)
Discussion started by: ad23
7 Replies
5. Shell Programming and Scripting
Hi,
Could someone please assist on a quick way of How to extract data from indexed files (ISAM files) maintained in an UNIX(AIX) server.The file data needs to be extracted in flat text file or CSV or excel format .
Usually we have programs in microfocus COBOL to extract data, but would like... (2 Replies)
Discussion started by: devina
2 Replies
6. Shell Programming and Scripting
Dear all,
I have a complex data file shown below,,,,,
A_ABCD_13208 0 0 4.16735 141044 902449 1293900 168919
C_ABCD_13208 0 0 4.16735 141044 902449 1293900 168919
A_ABCDEF715 52410.9 18598.2 10611 10754.7 122535 252426 36631.4
C_DBCDI_1353 0... (19 Replies)
Discussion started by: AAWT
19 Replies
7. Shell Programming and Scripting
Hello experts,
Please help me in achieving this in an easier way possible. I have 2 csv files with following data:
File1
08/23/2012 12:35:47,JOB_5330
08/23/2012 12:35:47,JOB_5330
08/23/2012 12:36:09,JOB_5340
08/23/2012 12:36:14,JOB_5340
08/23/2012 12:36:22,JOB_5350
08/23/2012... (5 Replies)
Discussion started by: asnandhakumar
5 Replies
8. Shell Programming and Scripting
File 1
ID Name Po1 Po2
DD134 DD134_4A_1 NN-1 L_0_1
DD134 DD134_4B_1 NN-2 L_1_1
DD134 DD134_4C_1 NN-3 L_2_1
DD142 DD142_4A_1 NN-1 L_0_1
DD142 DD142_4B_1 NN-2 L_1_1
DD142 DD142_4C_1 NN-3 L_2_1
DD142 DD142_3A_1 NN-41 L_3_1
DD142 DD142_3A_1 NN-42 L_3_2
File 2 ( Combination of... (1 Reply)
Discussion started by: pareshkp
1 Replies
9. UNIX for Dummies Questions & Answers
Hello Gurus,
Im new to scripting. Got struck with a file merge issue in Unix. Was looking for some direction and stumbled upon this site. I saw many great posts and replies but couldnt find a solution to my issue. Greatly appreciate any help..
I have three csv files -> Apex_10_Latest.csv,... (1 Reply)
Discussion started by: wamshi
1 Replies
10. Shell Programming and Scripting
We have the data looks like below in a log file.
I want to generat files based on the string between two hash(#) symbol like below
Source:
#ext1#test1.tale2 drop
#ext1#test11.tale21 drop
#ext1#test123.tale21 drop
#ext2#test1.tale21 drop
#ext2#test12.tale21 drop
#ext3#test11.tale21 drop... (5 Replies)
Discussion started by: Sanjeev G
5 Replies
LEARN ABOUT REDHAT
dbi::profiledumper::apache
DBI::ProfileDumper::Apache(3) User Contributed Perl Documentation DBI::ProfileDumper::Apache(3)
NAME
DBI::ProfileDumper::Apache - capture DBI profiling data from Apache/mod_perl
SYNOPSIS
Add this line to your httpd.conf:
PerlSetEnv DBI_PROFILE DBI::ProfileDumper::Apache
Then restart your server. Access the code you wish to test using a web browser, then shutdown your server. This will create a set of
dbi.prof.* files in your Apache log directory. Get a profiling report with dbiprof:
dbiprof /usr/local/apache/logs/dbi.prof.*
When you're ready to perform another profiling run, delete the old files
rm /usr/local/apache/logs/dbi.prof.*
and start again.
DESCRIPTION
This module interfaces DBI::ProfileDumper to Apache/mod_perl. Using this module you can collect profiling data from mod_perl applications.
It works by creating a DBI::ProfileDumper data file for each Apache process. These files are created in your Apache log directory. You
can then use dbiprof to analyze the profile files.
USAGE
LOADING THE MODULE
The easiest way to use this module is just to set the DBI_PROFILE environment variable in your httpd.conf:
PerlSetEnv DBI_PROFILE DBI::ProfileDumper::Apache
If you want to use one of DBI::Profile's other Path settings, you can use a string like:
PerlSetEnv DBI_PROFILE 2/DBI::ProfileDumper::Apache
It's also possible to use this module by setting the Profile attribute of any DBI handle:
$dbh->{Profile} = "DBI::ProfileDumper::Apache";
See DBI::ProfileDumper for more possibilities.
GATHERING PROFILE DATA
Once you have the module loaded, use your application as you normally would. Stop the webserver when your tests are complete. Profile
data files will be produced when Apache exits and you'll see something like this in your error_log:
DBI::ProfileDumper::Apache writing to /usr/local/apache/logs/dbi.prof.2619
Now you can use dbiprof to examine the data:
dbiprof /usr/local/apache/logs/dbi.prof.*
By passing dbiprof a list of all generated files, dbiprof will automatically merge them into one result set. You can also pass dbiprof
sorting and querying options, see dbiprof for details.
CLEANING UP
Once you've made some code changes, you're ready to start again. First, delete the old profile data files:
rm /usr/local/apache/logs/dbi.prof.*
Then restart your server and get back to work.
MEMORY USAGE
DBI::Profile can use a lot of memory for very active applications. It collects profiling data in memory for each distinct query your
application runs. You can avoid this problem with a call like this:
$dbh->{Profile}->flush_to_disk() if $dbh->{Profile};
Calling "flush_to_disk()" will clear out the profile data and write it to disk. Put this someplace where it will run on every request,
like a CleanupHandler, and your memory troubles should go away. Well, at least the ones caused by DBI::Profile anyway.
AUTHOR
Sam Tregar <sam@tregar.com>
COPYRIGHT AND LICENSE
Copyright (C) 2002 Sam Tregar
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.
perl v5.8.0 2002-11-29 DBI::ProfileDumper::Apache(3)