10-15-2013
I am getting same error ;
can't find the string terminator " ' " any where before EOF at -e line 1.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I'm trying to figure out how to build a small shell script that will find old .shtml files in every /tgp/ directory on the server and delete them if they are older than 10 days...
The structure of the paths are like this:
/home/domains/www.domain2.com/tgp/
/home/domains/www.domain3.com/tgp/... (1 Reply)
Discussion started by: Neko
1 Replies
2. UNIX for Dummies Questions & Answers
I have a text file with following content (3 lines)
filename : output.txt
first line:12/12/2008
second line:12/12/2008
third line:Y
I would like to know how we can replace 'Y' with 'N' in the 3rd line keeping 1st and 2nd lines same as what it was before.
I tried using cat output.txt... (4 Replies)
Discussion started by: santosham
4 Replies
3. Shell Programming and Scripting
Hi,
Please let me know how to find text and print text and its previous line. Please don't get irritated few days back I asked text and next line. I am using HP-UX 11.11
Thanks for your help. (6 Replies)
Discussion started by: kamranjalal
6 Replies
4. UNIX for Dummies Questions & Answers
hi,
I want to search all files in the current working direcotry and to print in comma (,) seperated output. But I have two patterns to search for.
Files will be in ABC20100508.DAT format.
Search should happen on the format (ABC????????.DAT) along with date(20100508).
I can do a
ls... (2 Replies)
Discussion started by: anandapani
2 Replies
5. Shell Programming and Scripting
Hello friends!
Help me pls to write correct awk and grep statements for my task:
I have got files with name filename.txt
It has such structure:
Start of file
FROM: address@domen.com (12...890) abc
DATE: 11/23/2009 on Std
SUBJECT: any subject
End of file
So, I must check,
if this file... (4 Replies)
Discussion started by: candyme
4 Replies
6. Shell Programming and Scripting
How can i grep for a pattern with wildcard using grep?
I want to identify all the lines that start with SAM and end in .PIPE
IN.TXT
SAM_HEADER.PIPE
SAM_DETAIL.PIPE
SAM_INVOICE.PIPE
Can i do something like
grep SAM*.PIPE IN.TXT (2 Replies)
Discussion started by: venky338
2 Replies
7. Shell Programming and Scripting
Practice folder contains many files and im interested in extracting file which starts with abc* ghi* xyz* . I need to do variety of operations for different files. if file starts with xyz* then i need to move to some destination otherwise some other destination. I am not able to make wildcard... (15 Replies)
Discussion started by: kumaar1986
15 Replies
8. Shell Programming and Scripting
Hi guys,
I have a text file named file1.txt that is formatted like this:
001 , ID , 20000
002 , Name , Brandon
003 , Phone_Number , 616-234-1999
004 , SSNumber , 234-23-234
005 , Model , Toyota
007 , Engine ,V8
008 , GPS , OFF
and I have file2.txt formatted like this:
... (2 Replies)
Discussion started by: An0mander
2 Replies
9. Shell Programming and Scripting
Hi
I have a set of input strings in a pattern as given below
string1 string2 string3 string4 string5
I need to search this sequence of strings from a file in such a way that the first two strings (string1 and string2) and last two strings (string4 and string5) should match with the... (8 Replies)
Discussion started by: my_Perl
8 Replies
10. Shell Programming and Scripting
Hello All,
I hope this is the right area. If not, Kindly let me know and I will report in the appropriate spot.
I am needing to find a search pattern that will make the * act as Wildcard in the search pattern instead of being literal.
The example I am using is bzgrep "to=<*@domain.com>"... (5 Replies)
Discussion started by: mancountry
5 Replies
LEARN ABOUT MOJAVE
ppi::token::heredoc
PPI::Token::HereDoc(3) User Contributed Perl Documentation PPI::Token::HereDoc(3)
NAME
PPI::Token::HereDoc - Token class for the here-doc
INHERITANCE
PPI::Token::HereDoc
isa PPI::Token
isa PPI::Element
DESCRIPTION
Here-docs are incredibly handy when writing Perl, but incredibly tricky when parsing it, primarily because they don't follow the general
flow of input.
They jump ahead and nab lines directly off the input buffer. Whitespace and newlines may not matter in most Perl code, but they matter in
here-docs.
They are also tricky to store as an object. They look sort of like an operator and a string, but they don't act like it. And they have a
second section that should be something like a separate token, but isn't because a strong can span from above the here-doc content to below
it.
So when parsing, this is what we do.
Firstly, the PPI::Token::HereDoc object, does not represent the "<<" operator, or the "END_FLAG", or the content, or even the terminator.
It represents all of them at once.
The token itself has only the declaration part as its "content".
# This is what the content of a HereDoc token is
<<FOO
# Or this
<<"FOO"
# Or even this
<< 'FOO'
That is, the "operator", any whitespace separator, and the quoted or bare terminator. So when you call the "content" method on a HereDoc
token, you get '<< "FOO"'.
As for the content and the terminator, when treated purely in "content" terms they do not exist.
The content is made available with the "heredoc" method, and the name of the terminator with the "terminator" method.
To make things work in the way you expect, PPI has to play some games when doing line/column location calculation for tokens, and also
during the content parsing and generation processes.
Documents cannot simply by recreated by stitching together the token contents, and involve a somewhat more expensive procedure, but the
extra expense should be relatively negligible unless you are doing huge quantities of them.
Please note that due to the immature nature of PPI in general, we expect "HereDocs" to be a rich (bad) source of corner-case bugs for quite
a while, but for the most part they should more or less DWYM.
Comparison to other string types
Although technically it can be considered a quote, for the time being "HereDocs" are being treated as a completely separate "Token"
subclass, and will not be found in a search for PPI::Token::Quote or "PPI::Token::QuoteLike objects".
This may change in the future, with it most likely to end up under QuoteLike.
METHODS
Although it has the standard set of "Token" methods, "HereDoc" objects have a relatively large number of unique methods all of their own.
heredoc
The "heredoc" method is the authoritative method for accessing the contents of the "HereDoc" object.
It returns the contents of the here-doc as a list of newline-terminated strings. If called in scalar context, it returns the number of
lines in the here-doc, excluding the terminator line.
terminator
The "terminator" method returns the name of the terminating string for the here-doc.
Returns the terminating string as an unescaped string (in the rare case the terminator has an escaped quote in it).
TO DO
- Implement PPI::Token::Quote interface compatibility
- Check CPAN for any use of the null here-doc or here-doc-in-s///e
- Add support for the null here-doc
- Add support for here-doc in s///e
SUPPORT
See the support section in the main module.
AUTHOR
Adam Kennedy <adamk@cpan.org>
COPYRIGHT
Copyright 2001 - 2011 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.18.2 2011-02-25 PPI::Token::HereDoc(3)