]> The Tcpdump Group git mirrors - tcpdump/commitdiff
man: Fix an example by quoting a filter expression
authorFrancois-Xavier Le Bail <[email protected]>
Sat, 21 Oct 2023 06:33:07 +0000 (08:33 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Sat, 21 Oct 2023 07:39:17 +0000 (09:39 +0200)
It's to prevent the shell from (mis-)interpreting the square brackets.

e.g. if there is a file named tcp1 in the current directory,
with tcp[13] == 2, the executed command will be:
tcpdump -i xl0 tcp1 == 2
Result: tcpdump: can't parse filter expression: syntax error

[skip ci]

tcpdump.1.in

index 85e3367cc395f0f35d92b2e27c955b9f35c1d843..6031816b8781db5a8813b7a596ebe350a6fb494c 100644 (file)
@@ -20,7 +20,7 @@
 .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 .\"
-.TH TCPDUMP 1  "20 September 2023"
+.TH TCPDUMP 1  "21 October 2023"
 .SH NAME
 tcpdump \- dump traffic on a network
 .SH SYNOPSIS
@@ -1530,7 +1530,7 @@ We can use this expression as the filter for \fItcpdump\fP in order
 to watch packets which have only SYN set:
 .RS
 .B
-tcpdump -i xl0 tcp[13] == 2
+tcpdump -i xl0 'tcp[13] == 2'
 .RE
 .PP
 The expression says "let the 13th octet of a TCP datagram have