The UNIX and Linux Forums
>
Top Forums
>
UNIX for Dummies Questions & Answers
Append file with grep output but add timestamp?
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Append file with grep output but add timestamp?
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
3
(
permalink
)
06-25-2009
Sepia
Registered User
Join Date: Apr 2007
Location: England
Posts: 49
Quote:
Originally Posted by
vgersh99
Code:
grep "monkey" zoo.log | tail -1 |
sed
"s/^/$(date)/" >> cron-zoo-log
Excellent.
That is putting the date before the grep result - is there a way to switch it around and maybe separate them by a comma?
Sepia
View Public Profile
Find all posts by Sepia
Find Sepia's past nominations received
Find Sepia's present nominations given