MYSYSAD.COM

Capitalize Strings in UNIX

· Shell & text

There might be times when you need to CAPITALIZE everything. The capitalize command handles this task well. Here is an example of its use.

Capitalize entire contents of a script or plain file
# cat testme | /usr/openwin/bin/capitalize -u
#!/BIN/KSH

IF [ $# = 0 ]; THEN
ECHO ADD AN ARGUMENT LIST
EXIT
FI
...

# cat Tech@Sakana | /usr/openwin/bin/capitalize -u
YOU CAN USE CAPITALIZE COMMAND OR THE UNIX TR COMMAND, WHICH WAS SUGGESTED BY STEPHANE KATTOOR

Capitalize the output of a command
# date | /usr/openwin/bin/capitalize -u
THU AUG 9 22:56:16 KST 2007

To lowercase , read this post: Output strings to lowercase