LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices



Reply
 
Search this Thread
Old 04-16-2004, 12:32 PM   #1
rridler
Member
 
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?

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

Rep: Reputation: 0
http://linuxcommand.org/wss0050.php#assign

might help
 
Old 04-16-2004, 03:51 PM   #3
mikshaw
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
1604
 
Old 04-16-2004, 05:43 PM   #4
rridler
Member
 
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.
 
  


Reply


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


All times are GMT -5. The time now is 10:33 PM.

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