LinuxQuestions.org
Review your favorite Linux distribution.
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 02-24-2012, 07:02 PM   #1
donnie1
LQ Newbie
 
Registered: Feb 2012
Posts: 2

Rep: Reputation: Disabled
Linux code help


if ($1)
then
echo "Argument not found: Usage: script filename.conf"
exit
else
awk '{print "ping -i " $2 " " $1 " &"}' $1 | sh
fi | tee -a monitoring.log
wait


How do I add a timestamp to this program?
 
Old 02-24-2012, 07:06 PM   #2
cbtshare
Member
 
Registered: Jul 2009
Posts: 610

Rep: Reputation: 42
simply use the date command...
Quote:
man date
and you'll see the myriad of formats you can get from it..
 
Old 02-24-2012, 07:08 PM   #3
Heraton
Member
 
Registered: Apr 2011
Location: Germany
Distribution: Mint 10, openSuSE
Posts: 58

Rep: Reputation: 3
Smile Easy?

Hello!

Looking for something like this?
Code:
echo `date`

Regards,

Heraton
 
Old 02-24-2012, 07:54 PM   #4
donnie1
LQ Newbie
 
Registered: Feb 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
thanks.
 
  


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
[SOLVED] Small matlab code to convert Morse code to plaintext using regular expressions gregorian Programming 3 03-31-2010 01:34 PM
pls convert this windows code into linux code nagendrar Programming 6 06-03-2008 08:00 AM
User Preferences: Use HTML code instead of vB code? (vB code is overrated) stefanlasiewski LQ Suggestions & Feedback 5 07-26-2005 02:37 AM


All times are GMT -5. The time now is 03:38 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration