Sponsored Content
Top Forums Shell Programming and Scripting egrep string except when preceded by underscore Post 302358271 by Scrutinizer on Friday 2nd of October 2009 01:06:58 AM
Old 10-02-2009
Quote:
Originally Posted by edidataguy
Won't this not work for you?
Code:
fgrep '_${' file

Hi editaguy, the OP was trying to match patterns without the preceding underscore. They should also be matched when at the beginning of a line.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Egrep cheat sheet anywhere? Looking for meaning of egrep -c

Hi I've been searching google and have not found what egrep -c means. Does anyone know where I can get a cheat sheet or what that -c means? thanks, Linda (2 Replies)
Discussion started by: leelm
2 Replies

2. UNIX for Dummies Questions & Answers

problem with underscore in variable name

can you help please. variable 1 = TODAY=`date +"%Y%m%d"` i.e. echo $TODAY 20080407 DB=GERMANY echo $DB GERMANY echo $DB.$TODAY GERMANY.20080407 echo $DB.$TODAY_1.dmp GERMANY..dmp (3 Replies)
Discussion started by: pinkie
3 Replies

3. UNIX for Dummies Questions & Answers

search ")" with egrep - egrep: syntax error

Hi Guys, we have a shell script which basically query the Database which retrieves huge data and use the data with "egrep" . Now there is some data which contains characters like "abc)" and the same is used like below : "egrep (.+\|GDPRAB16\|GDPR/11702 96 abc)\|$ temp.txt" now while... (7 Replies)
Discussion started by: sagarjani
7 Replies

4. Shell Programming and Scripting

allow only alphnumeric entry and an underscore

I am taking an user input which should only be an alphanumeric character or an underscore. How to i do it? (2 Replies)
Discussion started by: vickylife
2 Replies

5. Shell Programming and Scripting

ksh function getopts get leading underscore unless preceded by hyphen

If I call my function with grouped options: "logm -TDIWEFO 'message' ", then only the "T" gets parsed correctly. The subsequent values returned have underscores prefixed to the value: "_D", "_I", etc. If I "logm -T -DIWEFO 'message' ", the "T" and the "D" are OK, but "I" through "O" get the... (2 Replies)
Discussion started by: kchriste
2 Replies

6. UNIX for Advanced & Expert Users

google search changes with an underscore

How does adding an underscore change a google search? I was searching for John Elway and got different results with and without an unscore. (3 Replies)
Discussion started by: cokedude
3 Replies

7. Shell Programming and Scripting

Expect language separating two string connected by _(underscore)

Hi Folks, Anybody has an idea how to split string based on separator _ (underscore) in Expect programming language? e.g.if string is scmid1_scmid2 , i need to separate these two strings as scmid1 and scmid2. Thanks in advance. Sanket (1 Reply)
Discussion started by: Sanket
1 Replies

8. Shell Programming and Scripting

bash: need to have egrep to return a text string if the search pattern has NOT been found

Hello all, after spending hours of searching the web I decided to create an account here. This is my first post and I hope one of the experts can help. I need to resolve a grep / sed / xargs / awk problem. My input file is just like this: ----------------------------------... (6 Replies)
Discussion started by: bash4ever
6 Replies

9. Shell Programming and Scripting

underscore to dots

Hi, I have been trying to change underscores to dots. For example: 1122_91 1022_233 . 2237_23 9382_2339 2998_234 345_257 . . Desired output: 1122.91 1022.233 . 2237.23 9382.2339 2998.234 345.257 . . Any idea? Thanks (4 Replies)
Discussion started by: iconig
4 Replies

10. Shell Programming and Scripting

Egrep how to make sure string is after 5 comma

Hello, Need help... using egrep how do I make sure string is after 5th comma example: a,b,c,d,e,f,g,h,i Suppose i want to search letter f but want to make sure it is after 5th comma. Is there any way to check string is after 5th comma? Thanks !! (9 Replies)
Discussion started by: vegasluxor
9 Replies
Pod::Tree(3pm)						User Contributed Perl Documentation					    Pod::Tree(3pm)

NAME
Pod::Tree - Create a static syntax tree for a POD SYNOPSIS
use Pod::Tree; $tree = new Pod::Tree; $tree->load_file ( $file, %options) $tree->load_fh ( $fh , %options); $tree->load_string ( $pod , %options); $tree->load_paragraphs(@pod , %options); $loaded = $tree->loaded; $node = $tree->get_root; $tree->set_root ($node); $node = $tree->pop; $tree->push(@nodes); $tree->walk(&sub); $tree->has_pod and ... print $tree->dump; REQUIRES
Pod::Escapes EXPORTS
Nothing DESCRIPTION
"Pod::Tree" parses a POD into a static syntax tree. Applications walk the tree to recover the structure and content of the POD. See "Pod::Tree::Node" for a description of the tree. METHODS
$tree = "new" "Pod::Tree" Creates a new "Pod::Tree" object. The syntax tree is initially empty. $ok = $tree->"load_file"($file, %options) Parses a POD and creates a syntax tree for it. $file is the name of a file containing the POD. Returns null iff it can't open $file. See "OPTIONS" for a description of %options $tree->"load_fh"($fh, %options) Parses a POD and creates a syntax tree for it. $fh is an "IO::File" object that is open on a file containing the POD. See "OPTIONS" for a description of %options $tree->"load_string"($pod, %options) Parses a POD and creates a syntax tree for it. $pod is a single string containing the POD. See "OPTIONS" for a description of %options $tree->"load_paragraphs"(@pod, %options) Parses a POD and creates a syntax tree for it. @pod is a reference to an array of strings. Each string is one paragraph of the POD. See "OPTIONS" for a description of %options $loaded = $tree->"loaded" Returns true iff one of the "load_"* methods has been called on $tree. $node = $tree->"get_root" Returns the root node of the syntax tree. See Pod::Tree::Node for a description of the syntax tree. $tree->"set_root"($node) Sets the root of the syntax tree to $node. $tree->"push"(@nodes) Pushes @nodes onto the end of the top-level list of nodes in $tree. $node = $tree->"pop" Pops $node off of the end of the top-level list of nodes in $tree. $tree->"walk"(&sub) Walks the syntax tree, depth first. Calls sub once for each node in the tree. The current node is passed as the first argument to sub. "walk" descends to the children and siblings of $node iff sub() returns true. $tree->"has_pod" Returns true iff $tree contains POD paragraphs. $tree->"dump" Pretty prints the syntax tree. This will show you how "Pod::Tree" interpreted your POD. OPTIONS
These options may be passed in the %options hash to the "load_"* methods. "in_pod => 0" "in_pod => 1" Sets the initial value of "in_pod". When "in_pod" is false, the parser ignores all text until the next =command paragraph. The initial value of "in_pod" defaults to false for "load_file()" and "load_fh()" calls and true for "load_string()" and "load_paragraphs()" calls. This is usually what you want, unless you want consistency. If this isn't what you want, pass different initial values in the %options hash. "limit" => n Only parse the first n paragraphs in the POD. DIAGNOSTICS
"load_file"($file) Returns null iff it can't open $file. NOTES
No round-tripping Currently, "Pod::Tree" does not provide a complete, exact representation of its input. For example, it doesn't distingish between C<$foo-E<gt>bar> and C<< $foo->bar >> As a result, it is not guaranteed that a file can be exactly reconstructed from its "Pod::Tree" representation. L<> markups In the documentation of the L<"sec"> section in this manual page markup, "perlpod" has always claimed (the quotes are optional) However, there is no way to decide from the syntax alone whether L<foo> is a link to the foo man page or a link to the "foo" section of this man page. "Pod::Tree" parses "L<foo>" as a link to a section if "foo" looks like a section name (e.g. contains whitespace), and as a link to a man page otherswise. In practice, this tends to break links to sections. If you want your section links to work reliably, write them as "L<"foo">" or "L</foo>". SEE ALSO
perl(1), "Pod::Tree::Node", "Pod::Tree::HTML" ACKNOWLEDGMENTS
o <crazyinsomniac@yahoo.com> o <joenio@cpan.org> o Paul Bettinger <paul@n8geil.de> o Sean M. Burke <sburke@spinn.net> o Brad Choate <brad@bradchoate.com> o Havard Eidnes <he@NetBSD.org> o Rudi Farkas <rudif@bluemail.ch> o Paul Gibeault <pagibeault@micron.com> o Jay Hannah <jhannah@omnihotels.com> o Paul Hawkins <phawkins@datajunction.com> o Jost Krieger <Jost.Krieger@ruhr-uni-bochum.de> o Marc A. Lehmann <pcg@goof.com> o Jonas Liljegren <jonas@jonas.rit.se> o Thomas Linden <tom@co.daemon.de> o Johan Lindstrom <johanl@bahnhof.se> o Terry Luedtke <terry_luedtke@nlm.nih.gov> o Rob Napier <rnapier@employees.org> o Kate L Pugh <kake@earth.li> o Christopher Shalah <trance@drizzle.com> o Johan Vromans <JVromans@Squirrel.nl> AUTHOR
Steven McDougall <swmcd@world.std.com> COPYRIGHT
Copyright (c) 1999-2009 by Steven McDougall. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2010-06-21 Pod::Tree(3pm)
All times are GMT -4. The time now is 02:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy