Tuesday, January 12, 2010

My Workstation and the Tryst with Bash:

I run Ubuntu Jaunty Jackalope 9.04 with a BASH kernel, alongwith Windows Vista Home Premium with the boot-loader making it possible for Dual Booting.


The System I use is Dell Inspiron 1525 having 3GB RAM, 250 GB SATA Hard Drive, Intel Core 2 Duo Processor T6400 (965GM Chipset) and 15.4’ TFT Display. It also has a 8 in 1 Card Reader, Integrated 2.0 mega pixel webcam, and Intel Integrated Graphics Media Accelerator X3100 for rendering performance in 3D.


All in all the configuration is pretty decent. With many more specifications attracting people all around, the current ones for me are more than enough.


Few months back I was not more than a novice at GNU BASH (Bourne–Again Shell), which in layman terms provides a Command Line Interface for working on Unix/Linux systems and is the most common shell used on Linux systems. After gOogling and having some idea of it, I started experimenting with the version I had. To my surprise I started getting effective results, and it became my daily routine.


The little knowledge I gained gave me an idea about the Bash’s configuration files, which I eventually realized allows one to set an environment while logging in and logging out. These are 3 in number and convey a special meaning to the Bash. These files are generally present in home directory, but also depend largely on the Linux distro one is using and how the admin of the system has set up the account.


In my case these were missing. So here is how to create them using any of your favorite text editor. These are :

  • .bash_profile : Read and the commands in it are executed by bash everytime one logs into the system.
  • .bashrc : Read and executed by Bash everytime one start a subshell
  • .bash_logout : Read and executed by Bash everytime a login shell exits.


These files are useful for automatically executing commands like: set, alias, unalias and setting the PS- 1, 4 variables which can be used to modify the Bash Environment.


The best part of this rendezvous was when I managed to alter the command prompt look and information. This is done by setting the PS1 variable. The PS2 variable controls what is displayed after a second line of prompt is added and is usually by default ‘>’. The PS1 variable is usually set to show some useful information by the Linux distribution one is running.


All this has fascinated me to the core. I am reading more about these scripts and codes. Many more changes would be highlighted in the days to come. Linux is indeed fun to work with because you get what you do. However, Windows cannot be neglected any how as far as I am concerned.


P.S: This blog of mine was in hibernation for the last one year. I am back into it with some incidents occurring in my Computer World. I shall write more about Bash kernel and even tell you my tryst with the GRUB2, and other illogical crap which many of you give a brown krill about! Anyways, this is my LOVE!


P.P.S : The credit for the initial booting of the Linux version goes to one of my friend who loves to call him ProNoah (Pranav Gupta) – another Chemi-cool Sophomore.


Cheers! Ciao …

No comments: