Community discussions

 
wildbill442
Forum Guru
Forum Guru
Topic Author
Posts: 1050
Joined: Wed Dec 08, 2004 7:29 am
Location: Sacramento, CA

'grep' an output?

Tue Feb 13, 2007 11:36 pm

This is what I'm attempting to do:

/ip arp pr | grep aaa.bbb.ccc

how do I do this in mikrotik syntax? :?
 
wildbill442
Forum Guru
Forum Guru
Topic Author
Posts: 1050
Joined: Wed Dec 08, 2004 7:29 am
Location: Sacramento, CA

Tue Feb 13, 2007 11:40 pm

Nevermind, found my answer here: http://forum.mikrotik.com//viewtopic.ph ... light=grep

I found it easier to do a "pr file=abc" and ftp the file to a linux box and run cat abc | grep expression

I too second a similar implementation of grep! :)
 
difan
just joined
Posts: 7
Joined: Tue May 12, 2015 8:05 am

Re:

Mon Aug 03, 2015 8:59 pm

Nevermind, found my answer here: http://forum.mikrotik.com//viewtopic.ph ... light=grep

I found it easier to do a "pr file=abc" and ftp the file to a linux box and run cat abc | grep expression

I too second a similar implementation of grep! :)
Me too. MT has to keep in mind that not everybody is a programmer. In stressful support situation, an easier and a more efficient powerful CLI matters more.
 
patrick7
Member Candidate
Member Candidate
Posts: 298
Joined: Sat Jul 20, 2013 2:40 pm

Re: 'grep' an output?

Mon Aug 03, 2015 10:06 pm

 
pardim
just joined
Posts: 1
Joined: Wed Aug 30, 2017 4:04 am

Re: 'grep' an output?  [SOLVED]

Wed Aug 30, 2017 4:12 am

I've found the way below, I think could help anyone.

e.g:
ip arp print where address=192.168.10.1

Or

ip arp print where mac-address=00:00:00:00:00:01
 
cmaney
just joined
Posts: 18
Joined: Sat Aug 12, 2017 1:23 am

Re:

Fri Sep 01, 2017 6:10 pm


I found it easier to do a "pr file=abc" and ftp the file to a linux box and run cat abc | grep expression)
Just a quick aside, but there is no need to cat the file and pipe it to grep on any Unix/Linux variant I've ever seen. You can simply use: grep expression abc

So: grep 00:aa:15:aa:aa:aa myfilename will work without problems and save you some typing.
 
pe1chl
Forum Guru
Forum Guru
Posts: 5806
Joined: Mon Jun 08, 2015 12:09 pm

Re: Re:

Fri Sep 01, 2017 8:02 pm

Just a quick aside, but there is no need to cat the file and pipe it to grep on any Unix/Linux variant I've ever seen.
Of course it is required in order to earn the "useless use of cat award".
See http://porkmail.org/era/unix/award.html
 
mike99
just joined
Posts: 7
Joined: Tue Nov 10, 2015 11:52 pm
Location: Montreal

Re: 'grep' an output?

Tue Nov 13, 2018 6:59 pm

I was looking for the answer but only find this thread. After looking at the scripting wiki, I found this out.

/ip addr pr where address~"aaa.bbb.ccc"

Who is online

Users browsing this forum: No registered users and 11 guests