Copyright © 2008-2018, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.
Date: 2016may1 Language: bash Q. How can I change uppercase to lowercase in a bash script. A. Use the tr (translate) command:tr '[:upper:]' '[:lower:]' <filein >fileoutThe older style (that still works):tr '[A-Z]' '[a-z]' <filein >fileoutThis is slightly shorted but not quite as clear. To make the contents of a bash variable lowercase:myvar=$(echo $myvar | tr '[:upper:]' '[:lower:]')
Add a commentSign in to add a comment