10-28-2014
Works like a charm! Thanks!!
)
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello,
I am new to unix and would like to have a count of all the files in the current directory as well as all the files in a subdirectory.
The command I used was ls -R | wc -l
but the number returned wasn't correct. Can someone please help?
Thanks (2 Replies)
Discussion started by: cbeverly
2 Replies
2. Shell Programming and Scripting
Hi All,
How do i find out the number of files in a directory using unix command ? (14 Replies)
Discussion started by: Raynon
14 Replies
3. Shell Programming and Scripting
what's the script to do that?
i want to only count the number of files in that directory, not including any sub directories at all (5 Replies)
Discussion started by: finalight
5 Replies
4. Shell Programming and Scripting
I have 1800 files in a directory. The file name is like out_cpty_XXXX. The "XXXX" vaires from file to file. I want to get the count of files with file name out_cpty_XXXX. How to get the count with just the partial file name?
Any help would be appreciated? (4 Replies)
Discussion started by: Sangtha
4 Replies
5. UNIX for Dummies Questions & Answers
Hi,
Please let me know how to find out number of files in a directory excluding existing files..The existing file format will be unknown..each time..
Thanks (3 Replies)
Discussion started by: ammu
3 Replies
6. Shell Programming and Scripting
1) I need a shell code to count the number of files ( without directories or sub-directories ) in a directory given as arguments I tried this code but it didn't work , maybe I tried the wrong one:
numOfFiles=`find $1 -type f -maxdepth 1 | wc -l`
I found it in another thread in this site..
... (17 Replies)
Discussion started by: jack1985
17 Replies
7. Shell Programming and Scripting
Hi!
I just want to count number of files in a directory, and write to new text file, with number of files and their name
output should look like this,,
assume that below one is a new file created by script
Number of files in directory = 25
1. a.txt
2. abc.txt
3. asd.dat... (20 Replies)
Discussion started by: Akshay Hegde
20 Replies
8. Shell Programming and Scripting
hi I am trying to write a script to count the number of files, with slightly different subset name, in a directory
for example, in directory /data, there are a subset of files that are name as follow
/data/data_1_(1to however many).txt
/data/data_2_(1 to however many).txt... (12 Replies)
Discussion started by: piynik
12 Replies
9. Shell Programming and Scripting
Hi All!
I need to have a script that counts the number of files arriving in a landing directory, them some app pick these files to be processed and load to a DB. But this process is so fast that I am not able to count all the files arriving on a landing directory.
Please can you help?
My... (6 Replies)
Discussion started by: fretagi
6 Replies
10. Shell Programming and Scripting
Chaps, I need to count number of files in a remote directory from Linux (FreeBSD) as if 10 trace files (log files) been generated within 5min of time. So this is the script then I can setup a monitoring.
I came across with ls -1 \ip\d:\Logs | wc -l but then what else requires to check time... (8 Replies)
Discussion started by: samwijekoon
8 Replies
LEARN ABOUT DEBIAN
cgi::psgi
CGI::PSGI(3pm) User Contributed Perl Documentation CGI::PSGI(3pm)
NAME
CGI::PSGI - Adapt CGI.pm to the PSGI protocol
SYNOPSIS
use CGI::PSGI;
my $app = sub {
my $env = shift;
my $q = CGI::PSGI->new($env);
return [ $q->psgi_header, [ $body ] ];
};
DESCRIPTION
This module is for web application framework developers who currently uses CGI to handle query parameters, and would like for the
frameworks to comply with the PSGI protocol.
Only slight modifications should be required if the framework is already collecting the body content to print to STDOUT at one place
(rather using the print-as-you-go approach).
On the other hand, if you are an "end user" of CGI.pm and have a CGI script that you want to run under PSGI web servers, this module might
not be what you want. Take a look at CGI::Emulate::PSGI instead.
Your application, typically the web application framework adapter should update the code to do "CGI::PSGI->new($env)" instead of "CGI->new"
to create a new CGI object. (This is similar to how CGI::Fast object is initialized in a FastCGI environment.)
INTERFACES SUPPORTED
Only the object-oriented interface of CGI.pm is supported through CGI::PSGI. This means you should always create an object with
"CGI::PSGI->new($env)" and should call methods on the object.
The function-based interface like "use CGI ':standard'" does not work with this module.
METHODS
CGI::PSGI adds the following extra methods to CGI.pm:
env
$env = $cgi->env;
Returns the PSGI environment in a hash reference. This allows CGI.pm-based application frameworks such as CGI::Application to access PSGI
extensions, typically set by Plack Middleware components.
So if you enable Plack::Middleware::Session, your application and plugin developers can access the session via:
$cgi->env->{'plack.session'}->get("foo");
Of course this should be coded carefully by checking the existence of "env" method as well as the hash key "plack.session".
psgi_header
my ($status_code, $headers_aref) = $cgi->psgi_header(%args);
Works like CGI.pm's header(), but the return format is modified. It returns an array with the status code and arrayref of header pairs that
PSGI requires.
If your application doesn't use "$cgi->header", you can ignore this method and generate the status code and headers arrayref another way.
psgi_redirect
my ($status_code, $headers_aref) = $cgi->psgi_redirect(%args);
Works like CGI.pm's redirect(), but the return format is modified. It returns an array with the status code and arrayref of header pairs
that PSGI requires.
If your application doesn't use "$cgi->redirect", you can ignore this method and generate the status code and headers arrayref another way.
LIMITATIONS
Do not use CGI::Pretty or something similar in your controller. The module messes up CGI's DIY autoloader and breaks CGI::PSGI (and
potentially other) inheritance.
AUTHOR
Tatsuhiko Miyagawa <miyagawa@bulknews.net>
Mark Stosberg <mark@summersault.com>
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
CGI, CGI::Emulate::PSGI
perl v5.12.4 2011-08-29 CGI::PSGI(3pm)