Date related issue


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Date related issue
# 1  
Old 09-01-2010
Bug Date related issue

Hi,

I have
Code:
TDATE=$(date '+%b %d')

That stores "Sep 01" in the TDATE.

How I can store "Sep 1"?

Thanks in advance
# 2  
Old 09-01-2010
Depends on whether you want one or two spaces.

Code:
TDATE1="$(date +'%b %e')"
echo "${TDATE1}"
Sep  1

TDATE2="$(date +'%b %e'|tr -s ' ')"
echo "${TDATE2}"
Sep 1

This User Gave Thanks to methyl For This Post:
# 3  
Old 09-01-2010
Thank you very much!!

Regards,
Dipesh
# 4  
Old 09-01-2010
Thanks!!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help in an issue related to mailx

Hello, I have a file temp.txt with the below contents : Sep 9 03:04:51 adcsdp01 MAPDR2_00: Unable to open trace file adpstartarv.log. (Error 110 Resource temporarily unavailable) Sep 9 03:05:35 adcsdp01 MAPDR2_00: SAP Service ADPMR2_00 successfully started. Sep 9 03:04:51 adcsdp01... (7 Replies)
Discussion started by: rahul2662
7 Replies

2. AIX

IHS connector related loading issue

I am getting the following error on loading the connector DLL in IHS 8.5 on AIX 7.1 bash-4.2# /usr/32bit/IBM/HTTPServer/bin/apachectl start httpd: Syntax error on line 902 of /usr/32bit/IBM/HTTPServer/conf/httpd.conf: Cannot load /usr/<company_name>/IHS85/lib/libApache22Connector.a into... (3 Replies)
Discussion started by: George47
3 Replies

3. Shell Programming and Scripting

Small help related to date change

Hi, I am using this code in order to automate a commands in DB: begin for i in 0..23 loop dbms_output.put_line ( 'ALTER TABLE CRESTELMEDIATIONPRD501.TBLMEDIATIONCDR ADD PARTITION'||' ... (3 Replies)
Discussion started by: hitesh1907
3 Replies

4. UNIX for Advanced & Expert Users

Unix terminal display related issue

Want few input related to unix environment and terminal settings: 1. Am trying to find a way to keep the unix terminal display intact even after opening and closing a vi/less file. Currently if I open a vim file in the unix terminal and then close the file,it displays the contents of vim file on... (4 Replies)
Discussion started by: talktovkjain
4 Replies

5. Programming

Issue Related to Proxy Server

Hi All, I am establishing the proxy server to communicate the date between devices using serial port but after serial port connection,it should start the Proxy Server and still run till the communication is happening...but server became started but it became halted due to error - Please... (1 Reply)
Discussion started by: smartgupta
1 Replies

6. Programming

Issue Related to Splash Screen

Hi Guys, I am working with Solaris 9 and we are developing the application which will work on different OS.So we develop the GUI using JAVA swings... we want to display a Splash screen before starting the installation of the application... 1st we develop our application for windows and it is... (1 Reply)
Discussion started by: smartgupta
1 Replies

7. Programming

Issue related to native method

Hi, I am working with java and C/C++.In my java code I am using the native method to work with C/C++.So I am getting some error in C/C++ source code which I am not able to find it because It is throwing the only java null Exception.... Is there any way by which I can see the error in java console... (0 Replies)
Discussion started by: smartgupta
0 Replies

8. HP-UX

Facing an issue related to cronjob

Dear All, I am facing an issue related to cronjob and explained below is the case study: 1. I have a java class named "DmCheckRenditionQueue.java" and placed under "/cpc/documentum/product/5.2.5/tomcat/webapps/rendition" 2. When I am using the command "/usr/openv/java/jre/bin/java -cp... (1 Reply)
Discussion started by: parindam
1 Replies

9. Shell Programming and Scripting

file related issue

Hi all, Anybody knows how to write a script to open a file and store the weekday(mon-sun) on first line and current datetime on the second line of the file. If file doesn't exist, create a new one and store the weekday and current datetime. If it already exists, open it and get both... (2 Replies)
Discussion started by: k_oops9
2 Replies

10. UNIX for Dummies Questions & Answers

Date change related query

Good day folks, This is my first post on this board and I thank you in advance for helping me with this issue. Any idea how I can synchronize server time with another timeserver but have my server lag behind by 2 seconds? Meaning...I need a simple unix script that I can run as crone that... (2 Replies)
Discussion started by: franklo
2 Replies
Login or Register to Ask a Question