<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic perl equivalent of DCL search command in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/perl-equivalent-of-dcl-search-command/m-p/5156390#M41688</link>
    <description>I am looking for a perl script that performs the same function as the DCL search command.&lt;BR /&gt;&lt;BR /&gt;My company is switching from VAX to PC.  The Windows search provides only the name of files containing the search string.  I am VERY used to the DCL search feature of providing each line and the nearby lines (window) and would like to get the same capability on a PC.</description>
    <pubDate>Wed, 11 Feb 2009 14:56:24 GMT</pubDate>
    <dc:creator>Michael L. Mulhern</dc:creator>
    <dc:date>2009-02-11T14:56:24Z</dc:date>
    <item>
      <title>perl equivalent of DCL search command</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/perl-equivalent-of-dcl-search-command/m-p/5156390#M41688</link>
      <description>I am looking for a perl script that performs the same function as the DCL search command.&lt;BR /&gt;&lt;BR /&gt;My company is switching from VAX to PC.  The Windows search provides only the name of files containing the search string.  I am VERY used to the DCL search feature of providing each line and the nearby lines (window) and would like to get the same capability on a PC.</description>
      <pubDate>Wed, 11 Feb 2009 14:56:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/perl-equivalent-of-dcl-search-command/m-p/5156390#M41688</guid>
      <dc:creator>Michael L. Mulhern</dc:creator>
      <dc:date>2009-02-11T14:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: perl equivalent of DCL search command</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/perl-equivalent-of-dcl-search-command/m-p/5156391#M41689</link>
      <description>&lt;BR /&gt;I have a '\perl\bin\search.bat' that I _think_ came with the ActiveState perl distribution.&lt;BR /&gt;&lt;BR /&gt;It is a perl script and does roughly what you want. It starts with:&lt;BR /&gt;## search&lt;BR /&gt;##&lt;BR /&gt;## Jeffrey Friedl (jfriedl@omron.co.jp), Dec 1994.&lt;BR /&gt;## Copyright 19.... ah hell, just take it.&lt;BR /&gt;##&lt;BR /&gt;## BLURB:&lt;BR /&gt;## A combo of find and grep -- more or less do a 'grep' on a whole&lt;BR /&gt;## directory tree. Fast, with lots of options. Much more powerful than&lt;BR /&gt;## the simple "find ... | xargs grep ....". Has a full man page.&lt;BR /&gt;## Powerfully customizable.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Personally, I often stick to the one-liners:&lt;BR /&gt;&lt;BR /&gt;$ perl -le "print for (1000..4000)" &amp;gt; tmp.txt&lt;BR /&gt;$ perl -ne "$i=3 if /456/; print if $i-- &amp;gt; 0; print qq(\n) unless $i" tmp.txt&lt;BR /&gt;1456&lt;BR /&gt;1457&lt;BR /&gt;1458&lt;BR /&gt;&lt;BR /&gt;2456&lt;BR /&gt;2457&lt;BR /&gt;2458&lt;BR /&gt;&lt;BR /&gt;3456&lt;BR /&gt;3457&lt;BR /&gt;3458&lt;BR /&gt;&lt;BR /&gt;I have also create several search algoritmes with pre-match and post-match output in perl and awk..  but the OpenVMS SEARCH/WIN is the best!&lt;BR /&gt;&lt;BR /&gt;Google for "hein perl search" :-)&lt;BR /&gt;&lt;BR /&gt;One example for a searching with a window...&lt;BR /&gt;&lt;A href="http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=630972" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=630972&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It is not too hard to add a file widlcard, but typically goes beyond one-liners:&lt;BR /&gt;&lt;BR /&gt;$ perl -e "while ($f=shift) { open F,qq(&amp;lt;$f); while (&lt;F&gt;) { print qq ($f $. $_) if /main/} close F}" *.c&lt;BR /&gt;:&lt;BR /&gt;gbh.c 380 main(int argc, char *argv[])&lt;BR /&gt;getpos.c 12 int main(int argc, char *argv[]) {&lt;BR /&gt;getrmi.c 14 main(int argc, char *argv[])&lt;BR /&gt;:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy!&lt;BR /&gt;Hein&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/F&gt;</description>
      <pubDate>Wed, 11 Feb 2009 15:28:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/perl-equivalent-of-dcl-search-command/m-p/5156391#M41689</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-02-11T15:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: perl equivalent of DCL search command</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/perl-equivalent-of-dcl-search-command/m-p/5156392#M41690</link>
      <description>&lt;BR /&gt;Besides perl scripts, GNU grep or egrep will do &lt;BR /&gt;it as well with the -A,-B,-C,-NUM options.&lt;BR /&gt;Windows versions of these and other Unix utilities can be found at&lt;BR /&gt;  &lt;A href="http://unxutils.sourceforge.net/" target="_blank"&gt;http://unxutils.sourceforge.net/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Unix utilities are also part of the Cygwin suite for windows.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Feb 2009 16:04:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/perl-equivalent-of-dcl-search-command/m-p/5156392#M41690</guid>
      <dc:creator>Joseph Huber_1</dc:creator>
      <dc:date>2009-02-11T16:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: perl equivalent of DCL search command</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/perl-equivalent-of-dcl-search-command/m-p/5156393#M41691</link>
      <description>And the search script mentioned by Hein is contained in &lt;BR /&gt;  &lt;A href="ftp://ftp.cpan.org/pub/CPAN/authors/id/J/JF/JFRIEDL/jeffrey.perl.tar.gz" target="_blank"&gt;ftp://ftp.cpan.org/pub/CPAN/authors/id/J/JF/JFRIEDL/jeffrey.perl.tar.gz&lt;/A&gt;</description>
      <pubDate>Wed, 11 Feb 2009 16:22:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/perl-equivalent-of-dcl-search-command/m-p/5156393#M41691</guid>
      <dc:creator>Joseph Huber_1</dc:creator>
      <dc:date>2009-02-11T16:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: perl equivalent of DCL search command</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/perl-equivalent-of-dcl-search-command/m-p/5156394#M41692</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;A much tighter and much less readily understood rewrite of the wildcard search:&lt;BR /&gt;&lt;BR /&gt;Old:&lt;BR /&gt;&lt;BR /&gt;$ perl -e "while ($f=shift) { open F,qq(&amp;lt;$f); while (&lt;F&gt;) { print qq ($f $. $_) if /main/} close F}" *.c&lt;BR /&gt;&lt;BR /&gt;New:&lt;BR /&gt;&lt;BR /&gt;$ perl -ne "close ARGV if eof; print qq($ARGV $. $_) if /main/" *.c&lt;BR /&gt;&lt;BR /&gt;:-)&lt;BR /&gt;&lt;BR /&gt;&lt;/F&gt;</description>
      <pubDate>Thu, 12 Feb 2009 02:52:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/perl-equivalent-of-dcl-search-command/m-p/5156394#M41692</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-02-12T02:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: perl equivalent of DCL search command</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/perl-equivalent-of-dcl-search-command/m-p/5156395#M41693</link>
      <description>I downloaded Hein's search.bat from CPAN by following the explicit location provided by Joseph.  Many thanks!!!</description>
      <pubDate>Thu, 12 Feb 2009 11:43:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/perl-equivalent-of-dcl-search-command/m-p/5156395#M41693</guid>
      <dc:creator>Michael L. Mulhern</dc:creator>
      <dc:date>2009-02-12T11:43:41Z</dc:date>
    </item>
  </channel>
</rss>

