Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Easy Question:  Using the Date Command in a script

Posted on 2004-09-15
2
Medium Priority
?
182 Views
Last Modified: 2010-05-18
I'm new to linux scripting and Im trying to use the Date command in my script but can't completely figure out what the problem is.  I'm trying to have it show the Month Day, Year.  So for example today it would show  Sep 15, 2004.  I have it in my script as

date +%h +%d +%Y

but I get a "too many non-option arguments" error, and also how can I put in the comma to seperate the day from the year?

Thanks
0
Comment
Question by:kevin_ma
2 Comments
 
LVL 23

Accepted Solution

by:
brettmjohnson earned 2000 total points
ID: 12070811
The + switch specifies a format "string", try
date +"%h %d, %Y"
0
 

Author Comment

by:kevin_ma
ID: 12071191
Thanks it works!
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question