CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Combining 2 perl commands

 



Gaetan
New User

Mar 23, 2016, 2:21 AM

Post #1 of 3 (1212 views)
Combining 2 perl commands Can't Post

Hello.

How would I combine these 2 commands into 1

tail -F /usr/local/nagios/var/nagios.log | perl -pe 's/CRITICAL/\e[1;31;43m$&\e[0m/g'

and

tail -F /usr/local/nagios/var/nagios.log |perl -pe 's/(\d+)/localtime($1)/e'

Thanks
Cheers
Gaetan


FishMonger
Veteran / Moderator

Mar 23, 2016, 7:16 AM

Post #2 of 3 (1201 views)
Re: [Gaetan] Combining 2 perl commands [In reply to] Can't Post


Code
tail -F /usr/local/nagios/var/nagios.log | perl -pe 's/CRITICAL/\e[1;31;43m$&\e[0m/g; s/(\d+)/localtime($1)/e'



Gaetan
New User

Mar 23, 2016, 7:20 AM

Post #3 of 3 (1197 views)
Re: [FishMonger] Combining 2 perl commands [In reply to] Can't Post

FishMonger, thanks a million !

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives