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

what is the difference between running Wireshark by using ./wireshark and wireshark?

0

I'm asking because when I use ./wireshark I get an error message that is different from when I run it by using wireshark only.

Thanks in advance!

asked 16 Jun '14, 16:44

flora's gravatar image

flora
156313338
accept rate: 100%


One Answer:

1

In UNIX, a command on its own like "wireshark" will execute the "wireshark" program that is found in a directory in your "PATH" environmental variable. Using "./wireshark" would call the program "wireshark" in your current directory.

The distinction is useful if you have multiple versions of wireshark installed. To see which wireshark will be run when you just type "wireshark" try typing the command "which wireshark" and it will tell you what one is found in directories in your "PATH".

answered 16 Jun '14, 18:20

Quadratic's gravatar image

Quadratic
1.9k6928
accept rate: 13%

edited 16 Jun '14, 18:21

Thanks for your reply! So is it like "wireshark" runs what is in the install location but "./wireshark" runs what is in the build directory?

In deed, I've got confused when I found the following in a wireshark README.plugins file "The bad news is that Wireshark will not use the plugins unless the plugins are installed in one of the places it expects them to find. One way of dealing with this problem is to set an environment variable when running Wireshark: WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1. " why we should use that environmental variable if we are at the build directory already?!

(16 Jun '14, 19:34) flora
1

So is it like "wireshark" runs what is in the install location but "./wireshark" runs what is in the build directory?

"wireshark" runs whatever it first finds in your PATH; it might be in the current directory, if that's the first directory in PATH that contains a Wireshark binary (an empty entry in PATH means "the current directory"), or it might be in the install location, if that's the first directory in PATH that contains a Wireshark binary.

"./wireshark" runs whatever is in the current directory, which isn't guaranteed to be the build directory; if, for example, Wireshark is installed in "/usr/local/bin/wireshark", then, if you do "cd /usr/local/bin", and then do "./wireshark", it'll run what is in the current directory, i.e. it'll run "/usr/local/bin/wireshark".

why we should use that environmental variable if we are at the build directory already?!

Because Wireshark can't figure that out for itself, as it doesn't know what the build directory is.

(16 Jun '14, 19:54) Guy Harris ♦♦

Thanks for correcting me. It is clear now.

(17 Jun '14, 08:14) flora