This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

dumpcap invalid argument for port number

0

I've tried this in different variations but every time it comes up with the same message "Invalid argument: 5003"

dumpcap -i en0 -f “dst port 5003 and src port 5003” -b duration:3600 -b files:25 -w fmpackets.cap

using in Mac OSX terminal.

asked 26 Nov '13, 14:24

Dumpy's gravatar image

Dumpy
11114
accept rate: 0%

edited 26 Nov '13, 14:33


One Answer:

2
dumpcap -i en0 -f “dst port 5003 and src port 5003” -b duration:3600 -b files:25 -w fmpackets.cap

Try, instead

dumpcap -i en0 -f "dst port 5003 and src port 5003" -b duration:3600 -b files:25 -w fmpackets.cap

I.e., use regular ASCII quote marks, not opening and closing Unicode quotation marks; the command-line interpreters on OS X only allow ASCII single and double quotes as quote marks, just as they do on every other UN*X (because they're the same command-line interpreters as on other UN*Xes:

$ bash --version
GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)
Copyright (C) 2007 Free Software Foundation, Inc.
$ ksh --version
  version         sh (AT&T Research) 93u 2011-02-08
$ tcsh --version
tcsh 6.17.00 (Astron) 2009-07-10 (x86_64-apple-darwin) options wide,nls,dl,al,kan,sm,rh,color,filec
$ zsh --version
zsh 4.3.11 (i386-apple-darwin12.0)

on Mountain Lion, for example). They do not allow “ or ” to be used to quote strings.

answered 26 Nov '13, 14:39

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196
accept rate: 19%

That was it!!! Thank you!!

(26 Nov '13, 22:16) Dumpy