Saturday 17 May 2014

Use Bash in FreeBSD machine

Bash In FreeBSD
FreeBSD using C shell for the root user, and the user got sh for their shell by default. And there are so many shell can be used. But why you want to use bash at the first place, in FreeBSD terminal ?

One thing for sure, every Linux distribution by default using Bash as their shell of choice. This will get some compatibility if you create script which not run in Bash. So the options was you use bash or you change your script.

So the option to using bash shell in FreeBSD is open. we can change any type of shell we want to use. So now i will show how to change the default shell in FreeBSD which i had encounter and some tips which not a standard setup for Bash in FreeBSD.

First, install bash shell if not installed. Here are my step to install :

#cd /usr/ports/shell/bash

#make install clean



Then to change the shell as a user :

$ chsh


This will prompt user profile, change the shell to /usr/local/bin/bash

Then you can relogin to get the bash shell.

And in Linux , you can create profile for Bash, so when login the script executed. This was called .bashrc , but not in FreeBSD.

To make the bash start script run when user login, you must put it in .bash_profile .

This happend to me when i want to create a virtualenvwrapper setup in FreeBSD.

That's it. you have your Bash way.

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More