Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-16-2004, 12:32 PM   #1
Registered: Apr 2004
Location: N. Kentucky
Distribution: Fedora 13 and Fedora 14
Posts: 46

Rep: Reputation: 15
Help with BASH Commands

I am wanting to get the system date and pass it into a variable to use in other places in the script.

I have been able to set the variable name and pass text into it, but not the information returned by the date command.

Can anyone help me with this?

Old 04-16-2004, 01:42 PM   #2
LQ Newbie
Registered: Apr 2004
Distribution: sourcemage
Posts: 5

Rep: Reputation: 0

might help
Old 04-16-2004, 03:51 PM   #3
LQ Addict
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
You can format the date command to return strings in various formats.
for example:
> TODAY=`date +%d%m`
> echo $TODAY
Old 04-16-2004, 05:43 PM   #4
Registered: Apr 2004
Location: N. Kentucky
Distribution: Fedora 13 and Fedora 14
Posts: 46

Original Poster
Rep: Reputation: 15
Thank you very much, it worked.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
bash commands davatar Slackware 2 04-06-2005 04:05 AM
i need help with some newbie bash commands Alexander.s Programming 14 12-24-2004 03:33 PM
bash commands Obie Linux - Security 4 08-15-2004 03:42 PM
Bash commands PhuckFonix Linux - Newbie 2 03-30-2004 08:13 PM
Bash commands wprescott Linux - Distributions 6 04-27-2002 03:56 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:36 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration