Sponsored Content
Full Discussion: perl equivalent to grep -c
Top Forums Shell Programming and Scripting perl equivalent to grep -c Post 302186175 by era on Wednesday 16th of April 2008 02:47:51 PM
Old 04-16-2008
Code:
perl -lne '$count++ if m/$ARGV[0]/o; END { print $ARGV[0], $count }'

See also perlfaq4 - perldoc.perl.org
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

export equivalent command in PERL

Hi I need an equivalent command in PERL for the following. export LC_ALL=C; I hope this is the command. Please confirm this and correct me if i am wrong $ENV{LC_ALL}="C"; Thanks and Regards Ammu (1 Reply)
Discussion started by: ammu
1 Replies

2. Shell Programming and Scripting

strtok equivalent in perl

Hi All, Is their any equivalent for strtok (in c) to use in perl script. Thanks in advance. JS (1 Reply)
Discussion started by: jisha
1 Replies

3. Shell Programming and Scripting

need perl equivalent

Dear All, Good day, can any of you help me in the following problem: I need to find the perl equivalent for the following commandline grep characters |awk '{print \$2}'Expecting your reply and thanks in advance. Warm regards Fredrick. (4 Replies)
Discussion started by: Fredrick
4 Replies

4. Shell Programming and Scripting

grep -v equivalent in perl

I have to do grep -v in a perl script. I want to exclude blank lines and lines having visitor. #grep -v visitor abc.txt |grep '.' file:abc.txt 1340 not booked 16D:D9 tourist 8 1341 not booked 16C:D4 tourist 25 1342 not booked 16D:C4 visitor 7 1343 not booked 01C:D9 visitor 6 1344... (4 Replies)
Discussion started by: dynamax
4 Replies

5. Shell Programming and Scripting

GAWK/GREP Equivalent

What is GAWK equivalent to greps -B 5 -A 5? zgrep -i "^oct 20" /var/log/syslog*|grep -iB 5 -A 5 'postfix\/pickup /var/log/syslog.1.gz:Oct 20 01:55:01 elmo CROND: (mail) CMD (/usr/bin/python -S /usr/lib64/mailman/cron/gate_news) /var/log/syslog.1.gz:Oct 20 02:00:01 elmo CROND: (mail) CMD... (5 Replies)
Discussion started by: metallica1973
5 Replies

6. Shell Programming and Scripting

What is the equivalent of NR (awk) in perl?

Hello, I searched online; it seems that perl use $NR as NR in awk; however it does not work for me. For example, how to re-write the following awk using perl: awk '{ print NR}' inputfile---------- Post updated at 01:55 PM ---------- Previous update was at 12:49 PM ---------- I found... (2 Replies)
Discussion started by: littlewenwen
2 Replies

7. Shell Programming and Scripting

Perl equivalent substitution

hi Geeks, my input file contains data like => 53 - Deewana Kar Raha Hai.mp3 54 - Hale Dil.mp3 55 - Ishq Sufiyana.mp3 56 - Abhi Kuch Dino Se.mp3 57 - Pee Loon Hoto Ki Sargam.mp3 I had used sed command to remove the prefix from the file name like sed 's/^\ it gives me the perfect... (4 Replies)
Discussion started by: lohith.dutta
4 Replies

8. Shell Programming and Scripting

sed Equivalent for awk/grep

Any equivalent command using awk or grep? sed -n "/^$(date --date='10 minutes ago' '+%b %_d %H:%M')/,\$p" /abc.log (7 Replies)
Discussion started by: timmywong
7 Replies

9. Shell Programming and Scripting

Perl : Perl equivalent to the ksh | and ;

Ive been trying to move to Perl. It has been a struggle. My question is, is there a good resource that explains nesting statements. As an example. To change primary Factory CTS 1.9.0(46) P1 *Slot 1 CTS 1.10.2(42) P1 To primary *Slot 1 CTS 1.10.2(42) P1 ... (5 Replies)
Discussion started by: popeye
5 Replies

10. AIX

Need grep -v Equivalent for AIX

Need grep -v "Hello" equivalent for AIX (9 Replies)
Discussion started by: mohtashims
9 Replies
SVN::Class::Repos(3pm)					User Contributed Perl Documentation				    SVN::Class::Repos(3pm)

NAME
SVN::Class::Repos - represents the repository of a Subversion workspace SYNOPSIS
use SVN::Class; my $file = svn_file( 'path/to/file' ); my $info = $file->info; my $url = $info->url; print "repository URL is $url "; DESCRIPTION
SVN::Class::URL represents the source repository for a workspace. METHODS
SVN::Class::URL inherits from Rose::URI and SVN::Class. init Override the base Rose::URI method to set some default values in object. AUTHOR
Peter Karman, "<karman at cpan.org>" BUGS
Please report any bugs or feature requests to "bug-svn-class at rt.cpan.org", or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SVN-Class <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SVN-Class>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. SUPPORT
You can find documentation for this module with the perldoc command. perldoc SVN::Class You can also look for information at: o AnnoCPAN: Annotated CPAN documentation http://annocpan.org/dist/SVN-Class <http://annocpan.org/dist/SVN-Class> o CPAN Ratings http://cpanratings.perl.org/d/SVN-Class <http://cpanratings.perl.org/d/SVN-Class> o RT: CPAN's request tracker http://rt.cpan.org/NoAuth/Bugs.html?Dist=SVN-Class <http://rt.cpan.org/NoAuth/Bugs.html?Dist=SVN-Class> o Search CPAN http://search.cpan.org/dist/SVN-Class <http://search.cpan.org/dist/SVN-Class> ACKNOWLEDGEMENTS
I looked at SVN::Agent before starting this project. It has a different API, more like SVN::Client in the SVN::Core, but I cribbed some of the ideas. The Minnesota Supercomputing Institute "http://www.msi.umn.edu/" sponsored the development of this software. COPYRIGHT
Copyright 2008 by the Regents of the University of Minnesota. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Rose::URI, Path::Class, Class::Accessor::Fast, SVN::Agent, IPC::Cmd perl v5.14.2 2012-01-31 SVN::Class::Repos(3pm)
All times are GMT -4. The time now is 08:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy