I have the following awk script which I am using to print selected fields of the /etc/passwd file. I would like to change the case of the first letter of the user's first and last name (and the middle name if it exists) from lowercase to uppercase.
BEGIN {printf ("%-15s %-20s %-24s %-20s\n", "\nUsername"
,"Clock Number"," Name","Home Dir"
print "===========================================================================";FS=":|#|,"; OFS = "\t";}
{printf ("%-15s %-20s %-20s %-20s\n", $1, $5, $6, $10)}
The output currently displays:
Username Clock Number Name Home Dir
==========================================================
jim4 108556 jim bob /users/jim4
joe1 103546 joe b schmoe /users/j1
I would like it to display like:
Username Clock Number Name Home Dir
==========================================================
jim4 108556 Jim Bob /users/jim4
joe1 103546 Joe B Schmoe /users/j1
Any help would be greatly appreciated.
Thanks,
John
BEGIN {printf ("%-15s %-20s %-24s %-20s\n", "\nUsername"
,"Clock Number"," Name","Home Dir"
print "===========================================================================";FS=":|#|,"; OFS = "\t";}
{printf ("%-15s %-20s %-20s %-20s\n", $1, $5, $6, $10)}
The output currently displays:
Username Clock Number Name Home Dir
==========================================================
jim4 108556 jim bob /users/jim4
joe1 103546 joe b schmoe /users/j1
I would like it to display like:
Username Clock Number Name Home Dir
==========================================================
jim4 108556 Jim Bob /users/jim4
joe1 103546 Joe B Schmoe /users/j1
Any help would be greatly appreciated.
Thanks,
John