Redirect capitalize


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Redirect capitalize
# 1  
Old 10-30-2011
Redirect capitalize

How do i send the output from the date command to a variable called today easy:
today=$(date) but how can the output be capitalized on a single command ?
# 2  
Old 10-30-2011
Using parameter expansion in bash 4.x
Code:
today=$(date)
today="${today^^}"

This User Gave Thanks to danmero For This Post:
# 3  
Old 10-30-2011
In a single command:

Code:
today=$( date | tr "[a-z]" "[A-Z]" )

This User Gave Thanks to agama For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Web Development

Redirect URL containing #!

I have a Rewrite Rule that helps me redirect a page with no hindrance. I am rewriting mydomain.com/best to mydomain.com/#!/ using RewriteRule ^\/best\/? /#!/ Now I want to Rewrite mydomain.com/#!/best to (0 Replies)
Discussion started by: Junaid Subhani
0 Replies

2. UNIX for Dummies Questions & Answers

Replacing word and Capitalize words after

I have an assignment and I am not sure what to do. In Unix, I use PuTTY change the semicolon (;) to a period, and capitalize the first letter of the word immediately after it. I know change command is M-% and "." so only one semicolon is changed but I am not sure how to... (1 Reply)
Discussion started by: kathrut43
1 Replies

3. UNIX for Dummies Questions & Answers

HELP, Need to capitalize all files in dir without capitalizing extensions

Hello everyone, I may sound stupid for asking this but I have files that need to be loaded onto every system at work. When loaded the files are for example.... 5peasw.sim the end result needs to be 5PEASW.sim this is for over 50 files in the directory they go to. I am trying to... (5 Replies)
Discussion started by: E404UserNotFoun
5 Replies

4. Web Development

URL Redirect

Just want to give a background. Currently, our company web site is redesigned and there are about 200 current URLs will have new redirects. I don't want to enter them in the config file rather would like to have them in a text file/config file and referring the file from the config whenever the... (2 Replies)
Discussion started by: jawak
2 Replies

5. Shell Programming and Scripting

Redirect Problem

Hi, I have perl script which is calling an external command using "system()" with argument. But i am not able to capture the output.Even tried with backtick also with no luck. . . $number=<>; system ("cmd $number >output.txt"); (2 Replies)
Discussion started by: rasingraj
2 Replies

6. Shell Programming and Scripting

Trying to capitalize first letter of every word in Variable

Total Bash noob, have been successful in doing my script by searching and looking at examples, but I need some assitance with this one, just can't figure it out. In the Bash script I am trying to capitalize the first letter of every word in a string, ideally not changing other capitalization. ... (5 Replies)
Discussion started by: randyharris
5 Replies

7. Shell Programming and Scripting

Shell/Perl script to convert to Capitalize case

I need a shell script which will convert the given string within a <title> tag to Capitalize case. E.g "<title>hi man: check this out</title>" to "<title>Hi Man: Check This Out</title>" (11 Replies)
Discussion started by: parshant_bvcoe
11 Replies

8. UNIX for Dummies Questions & Answers

Capitalize who Output

i thought it could be done with who | tr ""'" but im not really translating anything. I've googled sed and grep and have looked in the man pages, as well as awk but cant really find a specifc regular expression to do what i need. (3 Replies)
Discussion started by: oxoxo
3 Replies

9. Shell Programming and Scripting

Redirect within ksh

I am using ksh on an AIX box. I would like to redirect the stdout and stderr to a file but also show them on the terminal. Is this possible? I have tried tee within my file without success. This is the code I have so far exec > imp.log 2>&1 | tee exec 1>&1 I am new to shell scripting, so... (3 Replies)
Discussion started by: podzach
3 Replies

10. IP Networking

Redirect

I'm sittig behind a firewall that doesn't allow ftp. I have a conection to a UNIX system, connecting throug SSH. Is it possible to redirect the ftp through the UNIX to my computer? (1 Reply)
Discussion started by: <Therapy>
1 Replies
Login or Register to Ask a Question