[wplug] case utility

Tom Rhodes trhodes at FreeBSD.org
Mon Apr 4 17:12:26 EDT 2005


On Mon, 4 Apr 2005 16:59:29 -0400 (EDT)
"James O'Kane" <jo2y at midnightlinux.com> wrote:

> On Mon, 4 Apr 2005, Teodorski, Christopher wrote:
> 
> > The question is:  Is there a good way to grab a filename from a
> > directory -- and match it regardless of case within all files in the
> > directory and if a match is found replace it with the proper case.
> 
> My first attempt at this would be a cross between bash and perl.
> I haven't tested it. Change .jpg and .html as needed.
> 
> for x in *.jpg
> do
>  	perl -pi.bak -e "s/$x/$x/i" *.html
> done

Perhaps filename == [A-Za-z]*.jpg  Or just *.jpg?

-- 
Tom Rhodes


More information about the wplug mailing list