Solved

Easy Question:  Using the Date Command in a script

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Shell script / command to generate IO / IOPS load 22 367
understanding an rpm spec file 5 60
Unix / Linux grid computing 5 157
What is the timeframe of this cron job? 2 136
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

777 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