<?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 Re: sh pattern matching problems in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2700004#M932844</link>
    <description>l1:/tmp 112 &amp;gt; ls -a la*&lt;BR /&gt;la111.081.Z    la11_22.081.Z  la2222.025     labcd&lt;BR /&gt;l1:/tmp 113 &amp;gt; perl -MFile::Find -le 'find(sub{m/^la\d+\.081/||return;print$File::Find::name},".")'&lt;BR /&gt;./la111.081.Z&lt;BR /&gt;l1:/tmp 114 &amp;gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 10 Apr 2002 12:41:28 GMT</pubDate>
    <dc:creator>H.Merijn Brand (procura</dc:creator>
    <dc:date>2002-04-10T12:41:28Z</dc:date>
    <item>
      <title>sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699987#M932827</link>
      <description>I don't understand the different results of my 'ls' and 'find' commands when using pattern matching.&lt;BR /&gt;&lt;BR /&gt;Here are my files :&lt;BR /&gt;la1111.081.Z&lt;BR /&gt;la11_22.081.Z&lt;BR /&gt;la2222.025&lt;BR /&gt;labcd&lt;BR /&gt;&lt;BR /&gt;I want to match files like these :&lt;BR /&gt;# ls la+([0-9]).081*&lt;BR /&gt;&lt;BR /&gt;But I don't manage to use this pattern matching&lt;BR /&gt;inside a 'find' command.&lt;BR /&gt;# find . -name "la+([0-9]).081*"&lt;BR /&gt;doesn't work.&lt;BR /&gt;&lt;BR /&gt;Instead,&lt;BR /&gt;# find . -name "la[0-9]*"&lt;BR /&gt;works, but this is not what i want.&lt;BR /&gt;&lt;BR /&gt;Could somebody help me ?&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Apr 2002 12:50:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699987#M932827</guid>
      <dc:creator>marc seguin</dc:creator>
      <dc:date>2002-04-09T12:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699988#M932828</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;try&lt;BR /&gt;&lt;BR /&gt;find la+([0-9]).081*&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;            Steve Steel</description>
      <pubDate>Tue, 09 Apr 2002 13:08:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699988#M932828</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2002-04-09T13:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699989#M932829</link>
      <description>I think this should work&lt;BR /&gt;find . -name "la*[0-9].081*" &lt;BR /&gt;&lt;BR /&gt;I am not a cracker in regular expresion, but you can read man 5 regexp ( 13 pages of .,+^[ and many others special chars.. ). Sure you will find the reason.&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Apr 2002 13:18:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699989#M932829</guid>
      <dc:creator>Carlos Fernandez Riera</dc:creator>
      <dc:date>2002-04-09T13:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699990#M932830</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;# find . -name "la*[0-9]*081*" &lt;BR /&gt;&lt;BR /&gt;Check the man pages of find and regexp.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Shiju&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Apr 2002 13:45:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699990#M932830</guid>
      <dc:creator>Helen French</dc:creator>
      <dc:date>2002-04-09T13:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699991#M932831</link>
      <description>Steve, your command works but it performs substitution before really executing the 'find' command (as in my 'ls' example). So it doesn't perform a recursive find in subdirectories.&lt;BR /&gt;&lt;BR /&gt;Carlos and Shizu, your pattern matches too many files (the two listed first in my example, and i want only the first one).&lt;BR /&gt;&lt;BR /&gt;I've read man pages. The problem is not "what would be the pattern to match my file ?" because I see it working with the 'ls' command.&lt;BR /&gt;But "How to use it with the 'find' command ?"&lt;BR /&gt;&lt;BR /&gt;thanks anyway</description>
      <pubDate>Tue, 09 Apr 2002 15:21:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699991#M932831</guid>
      <dc:creator>marc seguin</dc:creator>
      <dc:date>2002-04-09T15:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699992#M932832</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;# find . -name la+([0-9]).081* -depth&lt;BR /&gt;&lt;BR /&gt;This will check the subdirectories too.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Shiju</description>
      <pubDate>Tue, 09 Apr 2002 15:31:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699992#M932832</guid>
      <dc:creator>Helen French</dc:creator>
      <dc:date>2002-04-09T15:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699993#M932833</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;ls | grep "^la\([0-9].*\)\.081.*"&lt;BR /&gt;&lt;BR /&gt;so if you have these files:&lt;BR /&gt;&lt;BR /&gt;# ls la*     &lt;BR /&gt;la1111.081.Z   la2222.025     labcd          laninfo        laninfo2.sh&lt;BR /&gt;la11_22.081.Z  la22F22.025    lancards       laninfo.sh&lt;BR /&gt;&lt;BR /&gt;the grep returns this:&lt;BR /&gt;&lt;BR /&gt;# ls | grep "^la\([0-9].*\)\.081.*"&lt;BR /&gt;la1111.081.Z&lt;BR /&gt;la11_22.081.Z&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Apr 2002 15:53:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699993#M932833</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-04-09T15:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699994#M932834</link>
      <description>Hi Marc,&lt;BR /&gt;&lt;BR /&gt;Try your find command without the quotes it works for me ...&lt;BR /&gt;&lt;BR /&gt;find . -name la+([0-9]).081*&lt;BR /&gt;&lt;BR /&gt;-Thanks,&lt;BR /&gt;Shabu</description>
      <pubDate>Tue, 09 Apr 2002 15:54:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699994#M932834</guid>
      <dc:creator>SHABU KHAN</dc:creator>
      <dc:date>2002-04-09T15:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699995#M932835</link>
      <description>Marc,&lt;BR /&gt;&lt;BR /&gt;sorry, I misread your post, you only want this pattern:&lt;BR /&gt;&lt;BR /&gt;la####.081*&lt;BR /&gt;&lt;BR /&gt;so try this:&lt;BR /&gt;&lt;BR /&gt;# ls | grep "^la\([0-9]\)\{4\}\.081.*"&lt;BR /&gt;la1111.081.Z&lt;BR /&gt;# &lt;BR /&gt;&lt;BR /&gt;if you want this: la###...###.081*&lt;BR /&gt;&lt;BR /&gt;then change the \{4\} to \{4,\} to say at least four digits but any more is ok also.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 09 Apr 2002 16:14:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699995#M932835</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-04-09T16:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699996#M932836</link>
      <description>Harry, thanks for having interest, and I will use something like you wrote.&lt;BR /&gt;But I don't know why the 'find' command doesn't work.&lt;BR /&gt;Shabu, I do need quotes, and your command doesn't work when there are more than one file&lt;BR /&gt;matching. (explanation in my last post, about substitution)&lt;BR /&gt;It looks like the find command doesn't accept "(" symbols, only "?", "*" and "[".</description>
      <pubDate>Tue, 09 Apr 2002 17:32:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699996#M932836</guid>
      <dc:creator>marc seguin</dc:creator>
      <dc:date>2002-04-09T17:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699997#M932837</link>
      <description>Marc,&lt;BR /&gt;&lt;BR /&gt;I think this will solve your purpose ...&lt;BR /&gt;&lt;BR /&gt;find . -name  "la[0-9]*.081*"&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shabu</description>
      <pubDate>Tue, 09 Apr 2002 18:33:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699997#M932837</guid>
      <dc:creator>SHABU KHAN</dc:creator>
      <dc:date>2002-04-09T18:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699998#M932838</link>
      <description>Sorry Shabu, but your first star (*) means "Anything after one figure".&lt;BR /&gt;So it matches la4zzz.081</description>
      <pubDate>Tue, 09 Apr 2002 19:16:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699998#M932838</guid>
      <dc:creator>marc seguin</dc:creator>
      <dc:date>2002-04-09T19:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699999#M932839</link>
      <description>Hi Marc,&lt;BR /&gt;I didn't find a way to use quantifier that works in the name option of the find command, but if you need it in a script try something like this:&lt;BR /&gt;&lt;BR /&gt;The files are : &lt;BR /&gt;la1111.081.Z   &lt;BR /&gt;la11_22.081.Z  &lt;BR /&gt;la123.081.Z    &lt;BR /&gt;la2222.025     &lt;BR /&gt;la23.081.Z     &lt;BR /&gt;la23x.081.Z&lt;BR /&gt;labcd&lt;BR /&gt;&lt;BR /&gt;The command (in one line):&lt;BR /&gt;# find . \( -name "la[0-9][0-9].*.Z" -o  &lt;BR /&gt;    -name "la[0-9][0-9][0-9][0-9].*.Z"  -o  &lt;BR /&gt;    -name "la[0-9][0-9][0-9].*.Z" \)&lt;BR /&gt;&lt;BR /&gt;./la1111.081.Z&lt;BR /&gt;./la123.081.Z&lt;BR /&gt;./la23.081.Z&lt;BR /&gt;&lt;BR /&gt;Hope This helps&lt;BR /&gt;Lothar &lt;BR /&gt;</description>
      <pubDate>Wed, 10 Apr 2002 06:26:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2699999#M932839</guid>
      <dc:creator>Lothar Krueler</dc:creator>
      <dc:date>2002-04-10T06:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2700000#M932840</link>
      <description>Well... i have done several tests and :&lt;BR /&gt;&lt;BR /&gt;1- ls la+([0-9]).081* # runs OK&lt;BR /&gt;2- find la+([0-9]).081* # runs OK because REGEXP is interpreted by sh&lt;BR /&gt;&lt;BR /&gt;3- find . -name "la+([0-9]).081*" # never runs. Even man find says that expression will be interpreted by regexp, in facts it do not work, and so it must be a issue of find. IMMO.</description>
      <pubDate>Wed, 10 Apr 2002 07:48:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2700000#M932840</guid>
      <dc:creator>Carlos Fernandez Riera</dc:creator>
      <dc:date>2002-04-10T07:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2700001#M932841</link>
      <description>Lothar, it works, but it is not exactly the same.....&lt;BR /&gt;Carlos, it could be the conclusion to the story !&lt;BR /&gt;&lt;BR /&gt;I found an equivalent way to correspond to &lt;BR /&gt;#ls la+([0-9]).081* &lt;BR /&gt;&lt;BR /&gt;find . -name "la*.081*" ! -name "la*[!0-9]*.081*"&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Apr 2002 08:21:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2700001#M932841</guid>
      <dc:creator>marc seguin</dc:creator>
      <dc:date>2002-04-10T08:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2700002#M932842</link>
      <description>Hi Marc,&lt;BR /&gt;&lt;BR /&gt;I've been trying to figure this out and can't.  Hopefully someone else will.&lt;BR /&gt;&lt;BR /&gt;I do know that you are correct to escape your regexp in the find command with quotes.  Otherwise the shell will expand the regexp before passing it to find.  The only files found would be ones with names that match those found in the current directory.&lt;BR /&gt;&lt;BR /&gt;I'm still hoping for a resolution.&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
      <pubDate>Wed, 10 Apr 2002 12:06:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2700002#M932842</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-04-10T12:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2700003#M932843</link>
      <description>My guess is that find only supports basic regular expressions, not the extended variety (see the regexp(5) man page).  Hence the '+' character is not recognised as special because its only part of the extended regular expression syntax.&lt;BR /&gt;&lt;BR /&gt;You might like to try the GNU version of find at:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.connect.org.uk/hppd/hpux/Gnu/findutils-4.1.5/" target="_blank"&gt;http://hpux.connect.org.uk/hppd/hpux/Gnu/findutils-4.1.5/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Or alternatively pipe the output through grep -E.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Steve</description>
      <pubDate>Wed, 10 Apr 2002 12:36:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2700003#M932843</guid>
      <dc:creator>Steven Gillard_2</dc:creator>
      <dc:date>2002-04-10T12:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2700004#M932844</link>
      <description>l1:/tmp 112 &amp;gt; ls -a la*&lt;BR /&gt;la111.081.Z    la11_22.081.Z  la2222.025     labcd&lt;BR /&gt;l1:/tmp 113 &amp;gt; perl -MFile::Find -le 'find(sub{m/^la\d+\.081/||return;print$File::Find::name},".")'&lt;BR /&gt;./la111.081.Z&lt;BR /&gt;l1:/tmp 114 &amp;gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Apr 2002 12:41:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2700004#M932844</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-04-10T12:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: sh pattern matching problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2700005#M932845</link>
      <description>GNU find does not support the '+'</description>
      <pubDate>Wed, 10 Apr 2002 12:58:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-pattern-matching-problems/m-p/2700005#M932845</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-04-10T12:58:03Z</dc:date>
    </item>
  </channel>
</rss>

