The Haiku/BeOS Tip Server
Tips and tricks for Haiku/BeOS users

Don’t duplicate commands

Contributed by:
This tip is valid for: Haiku only

When you start working in Haiku, it is tempting to hit the repositories and download everything in sight. A lot of command-line files can be found there from the BeOS days. But you might want to check if you don’t already have them.

Take wget, for example: an excellent command-line utility that will reach out over the net and retrieve a file. You will find it on both Bebits and Haikuware, and if you download it you should install it into /boot/home/config/bin.

But wait a minute! Haiku already has its own wget, in /boot/system/bin. Now suppose you had both, which one would activate if you typed  wget in the Terminal? That is easy to find out, just type the following command:

echo $PATH

and it will spit out a list of directories all ending with “bin” (for “binary”). Whenever you type a command in the Terminal, it will search those directories, in that exact order, for something to execute. On a typical system, /boot/home/config/bin always wins.

In fact, Haiku contains a lot of these command-line utilities that used to be separate downloads in BeOS. When I examined my bin directories I found duplicates of wget, top, reindex, clear and tput.  Now maybe the one in /boot/home/config/bin really is more up-to-date, in which case you can just leave it alone. But will you remember to check after Haiku next receives an update? And there is a real possibility that you are using an out-of-date version.

So before you download and install anything for the Haiku command line, just open a Terminal and type that command to see if it isn’t there already.

Posted in Haiku, Terminal

One Response

  1. KeepSimple

    Thanks for this tip, maybe somebody at Haiku OS could write an application that compares the two dirs and reports the difference in version, and let you takes some action. What do you think about this?
    Kind regards!