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

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%


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

permanent link

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
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×1,620
×32
×13

question asked: 16 Jun '14, 16:44

question was seen: 1,238 times

last updated: 17 Jun '14, 08:14

p​o​w​e​r​e​d by O​S​Q​A