How to assing 'Mon DD' to a variable?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to assing 'Mon DD' to a variable?
# 1  
Old 07-15-2010
How to assing 'Mon DD' to a variable?

Hi Experts,

I am trying to assing a value of current 'Mon DD' to the variable following way:

l_day=date '+%b %d'

Unfortunately, at the time of run, it says ' +%b %d: not found'

Thanks
Dip
# 2  
Old 07-15-2010
Code:
l_day=`date '+%b %d'`
echo $l_day

or

Code:
l_day=$(date '+%b %d')
echo $l_day

tyler_durden
This User Gave Thanks to durden_tyler For This Post:
# 3  
Old 07-15-2010
Thanks Tyler!! It is working now!!
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

is there a way to assing variable a value that is output of a program in awk script?

Hi there is there a way to assing variable a value that is output of a program in awk script. For e.g., I did temp=(`grep "" $5 | cut -f8 -d' '`) but it does not work. Any advice??? Thanks in advance!!! :) (3 Replies)
Discussion started by: FUTURE_EINSTEIN
3 Replies

2. Shell Programming and Scripting

Converting Date from YYYYMMDD to DD-MON-YYYY

Hi , I need to convert date from YYYYMMDD to DD-MON-YYYY e.g 20111214 to 14-Dec-2011 Please help. (17 Replies)
Discussion started by: ady_koolz
17 Replies

3. Shell Programming and Scripting

Date conversion from DD MON YY to mmddyyyy

I am new shell scripting. Can someone please help in giving a shell script to convert from DD MON YY to mmddyyyy Example: Input1 :- 20 Apr 2011 Output2 should be :- 04202011 Input2 :- 09 MAR 11 Output :- 03092011 Input3 :- 30_JAN_11 Output :- 01302011 Need help in writing shell... (1 Reply)
Discussion started by: aakishore
1 Replies

4. Shell Programming and Scripting

Schedule a script to run at 10am from mon to fri

Hi, I need to write a shell script which will run i background and will execute other script only on Mon to Fri 10 AM but not on Sat and Sun. I am able to set it to run on every day at 10AM but how to make it to run only on Mon to Fri Thanks, Firestar. (7 Replies)
Discussion started by: firestar
7 Replies

5. Solaris

crontab to run mon.wed.fri

I have it set to the following 0 9 * * 1,3,5 /var/tmp/sys_diag It ran correctly on Wednesday but did not run on Friday and I am not sure why, does the above appear to be correct? (3 Replies)
Discussion started by: deaconf19
3 Replies

6. Shell Programming and Scripting

Unix date Format (MON)

Hi , Can any one give me what is the date format for 3 character Month all caps (MON) when I do date +%b it will give me Sep But I want this to be SEP (all caps) . Thanks in advance (1 Reply)
Discussion started by: umathurumella
1 Replies
Login or Register to Ask a Question