Sponsored Content
Full Discussion: grep -v equivalent in perl
Top Forums Shell Programming and Scripting grep -v equivalent in perl Post 302523490 by Klashxx on Thursday 19th of May 2011 03:23:34 AM
Old 05-19-2011
Will be better is you show us your script , anyway :
Code:
 perl -n -e 'if (!/visitor|^$/){print;}' file

An alternative (and nice) perl idiom:
Code:
perl -n -e 'print unless /visitor|^$/;' file


Last edited by Klashxx; 05-19-2011 at 05:04 AM..
 

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

perl equivalent to grep -c

Guess the subject lines says it all. What is the perl equivalent to grep -c -c, --count Suppress normal output; instead print a count of match- ing lines for each input file. With the -v, --invert- match option (see below), count non-matching lines. ... (6 Replies)
Discussion started by: popeye
6 Replies

3. 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

4. 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

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
SOAP::WSDL::Generator::Template::XSD(3pm)		User Contributed Perl Documentation		 SOAP::WSDL::Generator::Template::XSD(3pm)

NAME
SOAP::WSDL::Generator::Template::XSD - XSD code generator DESCRIPTION
SOAP::WSDL's XSD code generator SYNOPSIS
See wsdl2perl for an example on how to use this class. METHODS
new Constructor. Options (Options can also be set via set_OPTION methods): o silent Suppress warnings about what's being generated generate Shortcut for calling generate_typelib and generate_client generate_client Generates a client interface generate_server Generates a server class generate_typelib Generates type and element classes generate_typemap Generate a typemap class required by SOAP::WSDL's MessageParser generate_interface (Deprecated) alias for generate_client get_name_resolver Returns a name resolver template plugin visit_XSD_Attribute Visitor method for SOAP::WSDL::XSD::Attribute. Should be factored out into visitor class. visit_XSD_ComplexType Visitor method for SOAP::WSDL::XSD::ComplexType. Should be factored out into visitor class. visit_XSD_Element Visitor method for SOAP::WSDL::XSD::Element. Should be factored out into visitor class. visit_XSD_SimpleType Visitor method for SOAP::WSDL::XSD::SimpleType. Should be factored out into visitor class. AUTHOR
Replace the whitespace by @ for E-Mail Address. Martin Kutter E<lt>martin.kutter fen-net.deE<gt> LICENSE AND COPYRIGHT
Copyright 2008, 2009 Martin Kutter. This file is part of SOAP-WSDL. You may distribute/modify it under the same terms as perl itself Repository information $Id: WSDLParser.pm 770 2009-01-24 22:55:54Z kutterma $ $LastChangedDate: 2009-01-24 23:55:54 +0100 (Sa, 24 Jan 2009) $ $LastChangedRevision: 770 $ $LastChangedBy: kutterma $ $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/WSDLParser.pm $ perl v5.10.1 2010-12-21 SOAP::WSDL::Generator::Template::XSD(3pm)
All times are GMT -4. The time now is 02:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy