The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-26-2008
tekster757 tekster757 is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 33
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"...)
  #2 (permalink)  
Old 08-26-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,643
Code:
date | tr -s '[:lower:]'  '[:upper:]'
Please consider using the forum search - this same question has been asked several times in the past two weeks.
  #3 (permalink)  
Old 08-26-2008
tekster757 tekster757 is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 33
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
Closed Thread

Bookmarks

Tags
date to uppercase

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 08:40 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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