![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Change of date format | svenkatareddy | Shell Programming and Scripting | 2 | 05-23-2008 02:58 AM |
| Move A File With Same Date,don't Change The Desitination Dir Date | jee.ku2 | UNIX for Dummies Questions & Answers | 1 | 01-09-2008 01:42 PM |
| Need to change filenames in a particular directory from lowercase to UPPERCASE | Duke_Lukem | UNIX for Dummies Questions & Answers | 7 | 01-07-2008 06:32 PM |
| Change System Date | Ricole | AIX | 1 | 07-26-2006 10:29 PM |
| Change new filename with date ?? | sabercats | Shell Programming and Scripting | 9 | 02-13-2006 05:12 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Change date to uppercase
Hello,
I'm trying to take a 3 character date and change it to uppercase, does anyone know how to do that? Currently, all commands that I know of for changing strings/variables to uppercase change the command itself to uppercase, not the output. Here is what I've tried: date="date +%b" echo $date Aug echo $date | tr "a-z" "A-Z" DATE +%B echo "$date" | tr '[a-z]' '[A-Z]' DATE +%B OR: DATE=`echo $date|awk '{print toupper($0)}'` $DATE ksh: DATE: not found OR: print $date|sed 'y/[a-z]/[A-Z]' sed: Function y/[a-z]/[A-Z] cannot be parsed. Does anyone know how to get that date to all CAPS? (as you see above, it currently reads "Aug"...) |
|
||||
|
Thank you Jim!
![]() I adapted it to $date | tr -s '[:lower:]' '[:upper:]' and it worked - my apologies. I did try to find the answers, but I see that the phrases I searched on were bad because I couldn't seem to find the threads you referred to. That seems to be a big challenge to finding answers anywhere - getting the lingo right. I'm trying to figure out how people would search on something like that - "Changing shell variables to uppercase" or something? The more useful question would probably be: Any advice on good searching methods? Thanks again, Jim, in advance |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| date to uppercase |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|