Sign up ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.

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
share|improve this question
1  
See also: stackoverflow.com/questions/2264428/… –  Ja͢ck May 12 '12 at 7:28

1 Answer 1

up vote 4 down vote accepted

Use tr command:

tr '[:upper:]' '[:lower:]' < infile > outfile
share|improve this answer
3  
Better: '[:upper:]' '[:lower:]' –  Dennis Williamson May 12 '12 at 10:54
    
@DennisWilliamson: yes. i'll update it –  Prince John Wesley May 12 '12 at 12:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.