Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Iron

grep in clish mode?

Jump to solution

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
Highlighted
Silver

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

View solution in original post

12 Replies
Highlighted
Silver

Change into expert shell and type:

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

Iron

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
Highlighted
Silver

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' "

Highlighted
Iron

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
Highlighted
use quotes
# clish -c "show arp dynamic all" | grep --color 10.9.3.81
10.9.3.81 00:0C:29:29:DZ:0S
Highlighted
Iron
sorry but is desnt work too,
0 Kudos
Highlighted
Silver

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.

Highlighted
Iron
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
Highlighted
Silver

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

View solution in original post

Highlighted
Iron
ohhh sorry thank you !!!
0 Kudos
Highlighted
Pearl

😂 LOL!

0 Kudos
Highlighted
Employee
Employee

You need to use:

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