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
  • 398,947
  • 96
  • 818
  • 769
user121196
  • 30,032
  • 57
  • 148
  • 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
  • 62,492
  • 12
  • 87
  • 94