LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 04-10-2007, 08:31 PM   #1
Basslord1124
Member
 
Registered: Jun 2004
Location: Ashland, KY
Distribution: Debian, Puppy/Slacko
Posts: 351

Rep: Reputation: 31
shell command script question....


All right, I am in the process of putting together a small command script to run my IP monitoring software app (iptraf) on my server at boot time. Basically I am wanting it to run in the background and log my traffic. The question I have, is I want to put the current date in the log's filename when it originally gets created. How would I accomplish this? I have seen with some commands that it usually consists of a percent sign followed by some letter (ex: %M) to do certain things similar to what I am wanting...is that basically what I need to do?
 
Old 04-10-2007, 09:34 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Review the date(1) manpages (FORMAT section). Example:
Code:
[hector@troy ~]$ FILENAME=mylog$(date +%Y%m%d).log
[hector@troy ~]$ echo $FILENAME
mylog20070410.log
 
Old 04-11-2007, 05:36 PM   #3
Basslord1124
Member
 
Registered: Jun 2004
Location: Ashland, KY
Distribution: Debian, Puppy/Slacko
Posts: 351

Original Poster
Rep: Reputation: 31
Awesome, thanks.

I was kinda figuring that's what I'd have to do but just thought I'd double check to be sure.
 
  


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
command with shell script sunlinux Programming 2 12-29-2006 12:36 AM
Executing a shell script command!! vishamr2000 Programming 4 08-15-2005 01:33 AM
Command in shell script Grassie Coetzee Linux - Software 1 03-13-2005 12:42 PM
command not found (My shell script) Swift&Smart Linux - Software 3 05-16-2004 12:14 AM
Shell script login command? chup Linux - General 3 08-24-2003 07:43 PM


All times are GMT -5. The time now is 07:22 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