The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Changing userID and Changing group and GID deal732 Shell Programming and Scripting 2 04-18-2007 11:09 AM
changing my nickname Bashar Post Here to Contact Site Administrators and Moderators 4 01-30-2007 08:13 PM
(OSX) Capitalization using tr H1tokori OS X (Apple) 2 11-21-2005 07:09 PM
Changing the IP Address jyoung AIX 2 05-31-2005 08:52 AM
Changing IP's Hordak UNIX for Dummies Questions & Answers 2 08-03-2002 01:42 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-02-2005
TheCrunge TheCrunge is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 30
Changing capitalization

How would I go about taking a string, such as a name (first last) and changing the capitalization of the first letter of each name (First Last)?

A script that I am using outputs a list of names in all lower case, and I need to process the whole list to a new outfile giving the new capitalization.

Thanks!!
  #2 (permalink)  
Old 11-02-2005
futurelet futurelet is offline
Registered User
  
 

Join Date: Jul 2005
Posts: 137

Code:
ruby -pe 'gsub(/\w+/){|name| name.capitalize}'

  #3 (permalink)  
Old 11-09-2005
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,131

Code:
echo 'joe shmoe' | nawk '{for(i=1;i<=NF;i++)sub(/./,toupper(substr($i,1,1)),$i)}1'

Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:44 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0