uppercase to lowercase in bash on a mac

Posted by Mala on Stack Overflow See other posts from Stack Overflow or by Mala
Published on 2010-03-24T06:29:44Z Indexed on 2010/03/24 6:33 UTC
Read the original article Hit count: 463

Filed under:
|
|

Hi

I'm writing a bash script which needs to convert a string to lowercase. The problem is I'm doing it on a mac so 'tr' is not available. How can I go about doing this on a mac?

The problem I'm trying to tackle is that my script needs to recognize an if an extension is a .gif or a .jpg - and I don't want to have to check for .jpeg, .jPeg, .JPEG, .JPeg, etc etc etc... if there's a smarter way of doing this than just converting to lowercase and testing for gif, jpg and jpeg, i'm all ears :)

© Stack Overflow or respective owner

Related posts about bash

Related posts about mac