# Bash not found



## drunkenmidget (May 4, 2012)

I was hoping someone could explain to me why bash isn't found


```
httpd# bash
bash: Command not found.
httpd# whereis bash
bash: /usr/local/bin/bash
httpd# echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin
httpd# echo $SHELL
/bin/csh
```

It's weird because the location of the bash binary is located in /usr/local/bin and /usr/local/bin is in the shells path.  So, for the life of me, I can't figure out why typing *bash* throws a 'command not found' error.


----------



## bbzz (May 4, 2012)

`# rehash`


----------



## Grell (May 5, 2012)

Maybe I am being too obvious but bash is not installed with the FreeBSD base system, you need to install it via ports or packages


----------



## UNIXgod (May 5, 2012)

Grell said:
			
		

> Maybe I am being too obvious but bash is not installed with the FreeBSD base system, you need to install it via ports or packages



It's also in his first post "code quote" that he did indeed install it. As bbzz pointed out the c shell's hash needs to be updated via the rehash builtin() command.

Please look at #3 or wblock's Interrupted Unix faq:

http://www.wonkity.com/~wblock/docs/html/interrupted.html


----------



## drunkenmidget (May 5, 2012)

bbzz said:
			
		

> `# rehash`



Thanks, that did the trick.


----------



## drunkenmidget (May 5, 2012)

UNIXgod said:
			
		

> It's also in his first post "code quote" that he did indeed install it. As bbzz pointed out the c shell's hash needs to be updated via the rehash builtin() command.
> 
> Please look at #3 or wblock's Interrupted Unix faq:
> 
> http://www.wonkity.com/~wblock/docs/html/interrupted.html



I used a code quote because that's the only tag I remembered when I got balled out on my first post for not using proper tags for the code snippets and things.  I was on my 8th beer when I wrote my post and didn't feel like reading the long sticky note about formatting etc.  That would've been a real buzz kill. I hope the code quote was appropriate.  That was my second post here that I can remember.  Well second topic post anyway. I posted some replies to the 1st topic I created here.  So the second post thing isn't technically accurate.  It's really the second topic I've ever created here--at least as far as I can remember.  Anyway thanks. #3's answer sorted the problem, and I learned something.  As far as your post, as soon as I'm done typing this I'm going to peruse the link you gave me.  Thanks


----------



## UNIXgod (May 5, 2012)

drunkenmidget said:
			
		

> As far as your post, as soon as I'm done typing this I'm going to peruse the link you gave me.  Thanks



The man page for csh() may be more descriptive than builtin().

`% man csh | less -prehash`


```
[B]rehash[/B]  Causes  the internal hash table of the contents of the directo-
               ries in the path variable to be recomputed.  This is needed  if
               new  commands  are  added  to directories in path while you are
               logged in.  This should be necessary only if you  add  commands
               to  one  of  your  own  directories, or if a systems programmer
               changes the contents of one of the  system  directories.   Also
               flushes the cache of home directories built by tilde expansion.
```


----------

