<?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 find command with wildcards in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-wildcards/m-p/2617459#M885294</link>
    <description>hy admin's&lt;BR /&gt;i'll try to write my first shell script. I search for files in a directorytree which ended with htm, html, doc or pdf. The command ls /path *.@(htm|html|doc|pdf) shows the right files, but in a wrong output. Therefor i want to use the command find. With the commandline :&lt;BR /&gt;find /path -type f -iname '*.htm' -printf '\n %P'  i get the right output, but the wildcards like in the ls-command don't work.&lt;BR /&gt;Where is my problem!&lt;BR /&gt;</description>
    <pubDate>Tue, 20 Nov 2001 11:50:54 GMT</pubDate>
    <dc:creator>Werner Placke</dc:creator>
    <dc:date>2001-11-20T11:50:54Z</dc:date>
    <item>
      <title>find command with wildcards</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-wildcards/m-p/2617459#M885294</link>
      <description>hy admin's&lt;BR /&gt;i'll try to write my first shell script. I search for files in a directorytree which ended with htm, html, doc or pdf. The command ls /path *.@(htm|html|doc|pdf) shows the right files, but in a wrong output. Therefor i want to use the command find. With the commandline :&lt;BR /&gt;find /path -type f -iname '*.htm' -printf '\n %P'  i get the right output, but the wildcards like in the ls-command don't work.&lt;BR /&gt;Where is my problem!&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Nov 2001 11:50:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-wildcards/m-p/2617459#M885294</guid>
      <dc:creator>Werner Placke</dc:creator>
      <dc:date>2001-11-20T11:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: find command with wildcards</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-wildcards/m-p/2617460#M885295</link>
      <description>Try using double quotes &lt;BR /&gt;&lt;BR /&gt;"*.html"</description>
      <pubDate>Tue, 20 Nov 2001 11:56:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-wildcards/m-p/2617460#M885295</guid>
      <dc:creator>Duncan Edmonstone</dc:creator>
      <dc:date>2001-11-20T11:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: find command with wildcards</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-wildcards/m-p/2617461#M885296</link>
      <description>Hi,&lt;BR /&gt;You will have to use with find -o (OR):&lt;BR /&gt;find / \( -name \*.htm -o -name \*.html etc...&lt;BR /&gt;&lt;BR /&gt;All the best&lt;BR /&gt;&lt;BR /&gt;Victor</description>
      <pubDate>Tue, 20 Nov 2001 11:59:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-wildcards/m-p/2617461#M885296</guid>
      <dc:creator>Victor BERRIDGE</dc:creator>
      <dc:date>2001-11-20T11:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: find command with wildcards</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-wildcards/m-p/2617462#M885297</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;ls /path/*.@(html|html|pdf) is working for me.&lt;BR /&gt;  I think you may have missed the second /&lt;BR /&gt;&lt;BR /&gt;...BPK...</description>
      <pubDate>Tue, 20 Nov 2001 12:08:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-wildcards/m-p/2617462#M885297</guid>
      <dc:creator>Praveen Bezawada</dc:creator>
      <dc:date>2001-11-20T12:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: find command with wildcards</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-wildcards/m-p/2617463#M885298</link>
      <description>&lt;SEARCH for="" files="" in="" a="" directorytree="" which="" ended="" with="" htm=""&gt;&lt;BR /&gt;&lt;BR /&gt;This should work :&lt;BR /&gt;find /path  \( -name "*.htm" -o -name "*.html" -o -name "*.doc"  -name "*.pdf" \)  -print&lt;BR /&gt;&lt;BR /&gt;This should also work:&lt;BR /&gt;&lt;BR /&gt;find /path |grep -e "*.html" -e "*.doc" -e "*.pdf" -e "*.htm"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-raj&lt;BR /&gt;&lt;/SEARCH&gt;</description>
      <pubDate>Tue, 20 Nov 2001 12:31:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-wildcards/m-p/2617463#M885298</guid>
      <dc:creator>Roger Baptiste</dc:creator>
      <dc:date>2001-11-20T12:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: find command with wildcards</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-wildcards/m-p/2617464#M885299</link>
      <description>This is a problem with the way the shell intreprets things.&lt;BR /&gt;&lt;BR /&gt;In the shell the wildcard pattern (called a glob) is parsed by the shell *before* it is passed to the command, you can see this by typing set -x before running a command:&lt;BR /&gt;ls !(lost+found)&lt;BR /&gt;print !(lost+found)&lt;BR /&gt;&lt;BR /&gt;In the case of you find line - as soon as you quote a CLI parameter, whether using single or double quoting then the parameter isn't checked for globs eg try:&lt;BR /&gt;ls '!(lost+found)'&lt;BR /&gt;(the difference between " and ' is variable expansion - it will be expanded when the variable is between " but not when between ')&lt;BR /&gt;&lt;BR /&gt;Find, according to the manual page uses regular expressions (which are not the same as globs) - this are wrong. Find uses globs, but *not the same globs as the shell.*&lt;BR /&gt;&lt;BR /&gt;The standard glob characters are:&lt;BR /&gt;* - match 0 or more characters&lt;BR /&gt;? - match exactly one character&lt;BR /&gt;[] - match one of the characters in the []&lt;BR /&gt;&lt;BR /&gt;Korn Shell (and POSIX shell) add several other globs eg:&lt;BR /&gt;!() - find any filename not in the brackets&lt;BR /&gt;+() - find one or more filenames in the brackets&lt;BR /&gt;&lt;BR /&gt;Find uses non-korn shell globs - ie only *,? and []...&lt;BR /&gt;&lt;BR /&gt;The best solution for your problem is the following line:&lt;BR /&gt;&lt;BR /&gt;find /path -type f \( -name '*.htm' -o -name '*.html' -o '*.pdf' -o '*.doc' \) -print&lt;BR /&gt;&lt;BR /&gt;dave</description>
      <pubDate>Tue, 20 Nov 2001 12:52:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-wildcards/m-p/2617464#M885299</guid>
      <dc:creator>David Lodge</dc:creator>
      <dc:date>2001-11-20T12:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: find command with wildcards</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-wildcards/m-p/2617465#M885300</link>
      <description>Thank you very much! All the uggestions works fine. A special thanks to David Lodge for the explanation!&lt;BR /&gt;&lt;BR /&gt;Werner</description>
      <pubDate>Tue, 20 Nov 2001 13:07:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-wildcards/m-p/2617465#M885300</guid>
      <dc:creator>Werner Placke</dc:creator>
      <dc:date>2001-11-20T13:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: find command with wildcards</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-wildcards/m-p/2617466#M885301</link>
      <description>Werner,&lt;BR /&gt;Since you mention that the output of 'ls' is correct, let me point out that there is a fundamental difference between 'ls' and 'find'.&lt;BR /&gt;While 'ls /path' will only list files or directories in /path, find will search recursively in all subdirectories within /path. &lt;BR /&gt;For this reason, the list of files retrieved by these two commands may differ not just in format but in content as well.&lt;BR /&gt;Be sure of what you are looking for before you decide to use one or the other.&lt;BR /&gt;Good Luck.</description>
      <pubDate>Tue, 20 Nov 2001 13:21:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-wildcards/m-p/2617466#M885301</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2001-11-20T13:21:51Z</dc:date>
    </item>
  </channel>
</rss>

