Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
kobilevi
Participant
Jump to solution

grep in clish mode?

hello guys 

 

i using in checkpoint apllaiance 15600 i looking for some comment like grep but in clish mode ... 

 

 

example : show arp dynamic all | grep 1.1.1.1

 

 

 

0 Kudos
1 Solution

Accepted Solutions
Maik
Advisor

you. are. still. not. using. any. quotation. marks.

View solution in original post

12 Replies
Maik
Advisor

Change into expert shell and type:

clish -c "show arp dynamic all" | grep 1.1.1.1

kobilevi
Participant

when i type

grep | 1.1.1.1

 

i dont see noting in the output , but when i type in cilst mode without grep i see the resualt.... 

0 Kudos
Maik
Advisor

Grep is not available when your active shell is the Clish. As I mentioned, you need to move into the "Expert" shell aka bash and then execute your clish command via the just mentioned syntax:

 

" clish -c 'Here_goes_your_clish_command' | grep 'Here_goes_your_filter_keyword' "

kobilevi
Participant

9090.JPG

 

9091.JPG

 

as you can see there is no output..with grep comment 

 

when i in clish mode i have a output without grep

 

0 Kudos
Martin_Raska
Advisor
Advisor
use quotes
# clish -c "show arp dynamic all" | grep --color 10.9.3.81
10.9.3.81 00:0C:29:29:DZ:0S
kobilevi
Participant
sorry but is desnt work too,
0 Kudos
Maik
Advisor

That's because you did not follow my example. You need to specify your clish commands in quotes, as it is made of more than one statement. Type:

 

clish -c 'show arp dynamic all' | grep 10.110.12.162

 

Without the quotation marks the clish command will fail and instead print the help page, where your grep does not find anything at all. E.g.

[Expert@MyFirewall]# clish -c show configuration
Usage-
clish [-d DebugLevel -i -l ExtLck -s -o OutFmt { -c Cmd | -f File }]
-c Cmd ;Single command to execute.
-d N ;Debug Level in which shell should operate.
-f File ;File to load configuration from.
-i ;Ignore cmd failure in batch and continue.
-l ExtLck ;Use the given lock-id.
-o OutFmt ;Output format (pretty, xml, structured).
-s ;Issue 'save' at the end.

kobilevi
Participant
ok i leave the comment
clish -c show arp dynamic all | grep 10.110.12.162
the output still empty

what i doing worng?
0 Kudos
Maik
Advisor

you. are. still. not. using. any. quotation. marks.

kobilevi
Participant
ohhh sorry thank you !!!
0 Kudos
Danny
Champion Champion
Champion

😂 LOL!

0 Kudos
Eddie_Kalbert
Employee
Employee

You need to use:

clish -c 'show arp dynamic all' | grep 10.110.12.162

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events