Solved

Easy Question:  Using the Date Command in a script

Posted on 2004-09-15
2
176 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 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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 demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

856 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