Click here to get back home

Search.bat from the command line

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Search.bat from the command line bdy120602 06-17-2008
Posted by bdy120602 on June 17, 2008, 5:43 pm
Please log in for more thread options
I'm doing a search from the DOS prompt using the Perl search function
and I would like to search for a special character ($), but the Perl
command doesn't seem to be able to find it. I surround the dollar sign
in quotation marks, and it listed all the files in the directory,
which led me to believe that it couldn't initiate the search properly
because not all the documents contain the $. If I use search from the
Perl command line, meaning after I type "Perl" at the commadn prompt,
I receive

search/"$"
Final $ should be $ or $name at - line 1, within string
syntax error at - line 1, near "/"$""

Also, I'm searching RTF files. which have HTML coding behind them. Is
there anyway to have Perl search just the text and not the code?

Thanks.

Posted by David Filmer on June 17, 2008, 6:02 pm
Please log in for more thread options
bdy120602@gmail.com wrote:
> I'm doing a search from the DOS prompt using the Perl search function

Ah, I see your problem right there. Perl doesn't HAVE a search function
(it does have a s/// regular expression, but that doesn't seem to be
related to your question).

> If I use search from the
> Perl command line, meaning after I type "Perl" at the commadn prompt,
> I receive
>
> search/"$"
> Final $ should be $ or $name at - line 1, within string

The message is telling you something useful. Either the dollar-sign
should be escaped ($) or it should precede a variable name ($name). You
surely want to escape it (to treat it as a string-literal) but I don't
know why you're trying to do that division operation.

I suspect you are trying to run some Perl script and pass input. Show
us the relevant part of the script.


--
David Filmer (http://DavidFilmer.com)
The best way to get a good answer is to ask a good question.

Similar ThreadsPosted
command line search and replace dilemma September 11, 2004, 9:39 am
Command Line single execution of a line(s) of code April 15, 2005, 4:28 am
use one line Perl command to add a line at the begin of a file December 13, 2005, 3:25 pm
How to search a string in a given line February 7, 2006, 4:12 am
Can't use an undefined value as an ARRAY reference at search.cgi line 139. September 11, 2007, 2:15 pm
unicode (hebrew) regexp search for new line headaches December 4, 2005, 10:46 pm
Error in command line January 30, 2005, 4:04 am
Error in command line January 31, 2005, 6:21 am
Parameters in command line February 20, 2005, 12:31 pm
file name from command line March 23, 2005, 8:29 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap