Operating System - HP-UX
1819796 Members
3136 Online
109607 Solutions
New Discussion юеВ

find command case insensitive ?

 
SOLVED
Go to solution
machoq1
Esteemed Contributor

find command case insensitive ?

I am trying to write a wrapper script around the find command but with a case insensitivity.
How can i use the find command in a case insensitive manner ?
4 REPLIES 4
Pete Randall
Outstanding Contributor

Re: find command case insensitive ?

find /start_dir -name "[Ss][Aa][Kk][Ee][Tt]"

should do it.


Pete

Pete
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: find command case insensitive ?

The easist way is to download and install the Gnu version from any of the HP-UX Porting Centre's. The key to build a wrapper script is to use the tr command to uppercase or lowercase character by character the target string and then construct the -name argument something like this:

find . -name "[Dd][Uu][Mm][Bb][Oo]"

which would find Dumbo, dumbo, DuMbO, ...
If it ain't broke, I can fix that.
machoq1
Esteemed Contributor

Re: find command case insensitive ?

will pursue the tr command
Rodney Hills
Honored Contributor

Re: find command case insensitive ?

The gnu find utility would be the best way. You can find it at Software and Porting Centre-

http://hpux.cs.utah.edu/hppd/hpux/Gnu/findutils-4.2.20/

Then you can use the option -iname for insenstive-case name search.

find -iname "DUMBO*" -print

to find all files beginning with dumbo in any combination of upper/lower case.

HTH

-- Rod Hills
There be dragons...