0

I have Ubuntu 14.04 and my bluetooth stopped working. The accepted solution for this problem is to find the driver in hex format and convert it to hcd for installation:

sudo apt-get install git
git clone git://github.com/jessesung/hex2hcd.git
cd hex2hcd
make
./hex2hcd ../BCMxxxx.xxx.xxx.xx.hex BCM43142A0-0a5c-21d7.hcd (Correct hex file and required hcd name here)

So I followed the commands and installed git and everything seems to go just fine until the end when I get a "command not found":

$ git clone git://github.com/jessesung/hex2hcd.git
Cloning into 'hex2hcd'...
remote: Counting objects: 8, done.
remote: Total 8 (delta 0), reused 0 (delta 0), pack-reused 8
Receiving objects: 100% (8/8), 8.71 KiB | 0 bytes/s, done.
Resolving deltas: 100% (1/1), done.
Checking connectivity... done.
~$ cd hex2hcd
:~/hex2hcd$ make
gcc -O2 -march=native    hex2hcd.c   -o hex2hcd
~/hex2hcd$ hex2hcd BCM43142A0_001.001.011.0084.0086.hex BCM43142A0-0a5c-21d7.hcd
hex2hcd: command not found

Why am I getting "command not found" ???

If i look in the directory the command hex2hcd is present:

~/hex2hcd$ ls
BCM43142A0_001.001.011.0084.0086.hex  hex2hcd  hex2hcd.c  LICENSE  Makefile

And if I examine the hex2hcd file its properties are executable.

I do not know what to do next to resolve this.

hmm. This question has been marked as a duplicate to:

How to run scripts without typing the full path?

But I do not understand how that helps or how I would have ever found that page. Actually another suggest to prepend ./ before my command is a helpful answer as it has solved the problem. But that solution is not found on the page marked as duplicate.

I don't understand why I need to prepend ./ when I am already in the directory with the command ... So I have a solution but do not understand why it is needed.

3
  • How about trying ./hex2hcd BCM43142A0_001.001.011.0084.0086.hex BCM43142A0-0a5c-21d7.hcd, i.e., add ./ in front?
    – edwinksl
    Jun 20, 2016 at 5:20
  • You should reply to our comments too in addition to editing the question, otherwise I wouldn't have known you tried what I said. In any case, a bare hexhcd does not work because it is not in your PATH. Appending ./ works because . is an alias for the current directory, so ./hexhcd is one way of specifying the path to hexhcd. The duplicate target that @muru posted provides ways to modify PATH by creating symlinks or editing ~/.bashrc.
    – edwinksl
    Jun 20, 2016 at 6:21
  • 1
    See unix.stackexchange.com/questions/4430/…
    – muru
    Jun 20, 2016 at 6:23

1 Answer 1

3

Because the folder where that file is is not in PATH variable, and by default any command you just type into the prompt will be searched from the list of dirs in the PATH. You can type in git and run it just like that because it's located in some directory that is listed in PATH and yours is not.

Use ·/command , give full path like /home/admin/somedir/command , or add that dir to your PATH variable. Alternative is also to make an alias to the full path.

In your case the last command should be

./hex2hcd BCM43142A0_001.001.011.0084.0086.hex BCM43142A0-0a5c-21d7.hcd
1
  • If this answer has answered your question, please consider leaving an upvote and/or marking this answer as accepted Jun 20, 2016 at 7:47

Not the answer you're looking for? Browse other questions tagged .