Unix Shell - Re: convert 1st char of a word to uppercase

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > April 2005 > Re: convert 1st char of a word to uppercase





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: convert 1st char of a word to uppercase
Bill Seivert

2005-04-27, 2:48 am



Michael Heiming wrote:
> In comp.unix.shell Ed Morton <morton@lsupcaemnt.com>:
>
>
>
>
>
> [..]
>
>
>
>
>
>
> If you can live without redirecting stderr?
> vim file << EOF^J:%s/\<\(.\)\([^ ]*\)/\u\1\L\2/g^J:wq!EOF
>
>
>
>
>
> We don't know, the OP was just a single line.;)
>
>
>
>
>
>
> Exactly, this is the beauty about unix, there are always a couple
> of possible ways doing things, reminds me sometimes of a Lego
> construction set for kids that have grown up, somehow...;)
>

I know Sun OS has a capitalize program (though I'm not at work
to verify the name), but it has three modes (based on command
line options):

abcd -> ABCD
ABCD -> abcd
abcd -> Abcd

Reads stdin, converts, and prints to stdout.

Bill Seivert

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com