2

how to lowercase everything in a text file and then output the result to a new file in bash script? for example the input file contains

a
bC
D
E

output

a
bc
d
e
skaffman
  • 390,936
  • 96
  • 800
  • 764
user121196
  • 28,674
  • 57
  • 144
  • 198
  • 1
    See also: http://stackoverflow.com/questions/2264428/converting-string-to-lower-case-in-bash-shell-scripting – Ja͢ck May 12 '12 at 07:28

1 Answers1

4

Use tr command:

tr '[:upper:]' '[:lower:]' < infile > outfile
Prince John Wesley
  • 60,780
  • 12
  • 83
  • 92