Hack 21. Change the Case
Convert a file to all upper-case:
$ cat employee.txt

100 Jason Smith
200 John Doe
300 Sanjay Gupta
400 Ashok Sharma
$ tr a-z A-Z < employee.txt
100 JASON SMITH
200 JOHN DOE
300 SANJAY GUPTA
400 ASHOK SHARMA
Convert a file to all lower-case:
$ cat department.txt

100 FINANCE
200 MARKETING
300 PRODUCT DEVELOPMENT
400 SALES
$ tr A-Z a-z < department.txt
100 finance
200 marketing
300 product development
400 sales
0 comments:
Post a Comment