The bashrc bash configuration files

The default shell in most Linux distributions is the bash shell. Contrary to all the usability work that has been done to the GUI, the shell is most neglected area.

Current bashrc shell (shows prompt only)

Depicting a shell is not an easy task; in the screenshot above we only show the default prompt. It has the following disadvantages,

  1. It does not differentiate visually between the username and hostname.
  2. It shows the relative path only, making it difficult to realize quickly the full path for the current working directory.
  3. Cannot copy the path using the mouse by double-clicking on it. The ~ is not included in the highlighted text, that one needs to paste and add the remaining part of the path (such as /home/user/)
  4. The point of input changes position on the command line, depending on the size of the path. As you cd into directories, the point of input moves further to the right.

The bashrc project shell

This is the prompt with the bashrc project configuration files. It solves the problems described with the default configuration files found in Linux distributions.

Obviously, there are more to the shell’s configuration files than a usable prompt. For example,

  • the ability to show the partial matches when you press Tab for the first time
  • enabling the shopt options to reasonable values
  • have reasonable aliases for . .. … / –
  • adding –verbose, –interactive to basic utilities such as cp, mv, rm
  • show the exit value of an application if it is other than 0 ($?)

There is a EnhancedBash project for the Ubuntu Linux distribution which might be able to break apart and provide better default configuration files.

If you want to help and add more to the proposed configuration, visit http://github.com/simos/bashrc/

To use the bashrc shell, you need to

  1. Download the latest package from http://github.com/simos/bashrc/ (note the Download button).
  2. Extract the package, open a terminal window and enter the newly created directory.
  3. Run make install
  4. Open a new shell window. The new settings should be activated.

Permanent link to this article: https://blog.simos.info/the-bashrc-bash-configuration-files/

5 comments

Skip to comment form

  1. Will this works for mac?

    I tried on my OSX 10.5.6 but seems dosen’t work.

    This is the message followed by “sudo make systeminstall”

    sudo make systeminstall
    Password:
    -n Copying config files to /usr/share/bashrc…
    done.
    -n Copying bashrc_config to /usr/bin…
    done.

    You can now use bashrc_config
    as root to populate the /etc/skel directory
    so that each new user will have the config files,
    or
    as any user to have your own copy of the
    bashrc configuration files in your home directory.

    Q: Did you put the dot files in /etc/skel? A: No, use bashrc_config.

    —–

    Where I have done wrong?

    BTW: It works great on my Ubuntu box, I’m loving it.
    But your mail system treated my email address as spam. It seems doesn’t like emails contains the word “spam”, in which case a true spam won’t put spam in.

  2. Thanks for the feedback.
    It appears that OS/X does not have the GNU ‘echo’ command which supports the command line option ‘-n’ (do not change line after echo-ing text).

    My blog uses a spam plugin that caught your post. I just released it.

  3. I use Ubuntu and am seeking a way to use polytonic Greek in bash utilities such as sort and uniq. Right now the diacritics confuse the algorithms when I use the locale el_GR-utf8. Do any of y’all know of a way to get this working, perhaps by editing the locale? Has this been done already? Ζη Χριστος!

  4. @Darrell:

    I believe you are trying to sort strings that start with, for example α, ᾳ ,ᾅ, and you notice that these words are not grouped together under «α».

    Unfortunately, there is no support yet in glibc for ancient Greek.

    2883 # GREC
    2884 #
    2885 # accent aigu/tonos/acute accent
    2886 # trma/dialytica/diaeresis
    2887 # dialytika tonos
    2888 #

    Reference: http://repo.or.cz/w/glibc.git/tree/HEAD:/localedata/locales

    No support in glibc means that all those basic command line scripts like ‘sort’ do not recognise yet Ancient Greek.

    I believe there is support for Ancient Greek collation in the CLDR locale database. Therefore, collation should work in OpenOffice.org (uses CLDR), or you could write a script in, let’s say, Python, using the Python ICU bindings (see http://pypi.python.org/pypi/PyICU/). More scripting languages should have ICU bindings.

    Χριστὸς ἀνέστη!

  5. Thanks. I’ll just have to use Python or PHP. James Tauber, Weston Ruter and Open Scriptures are working on tokenizing various manuscripts using python so I’ll just follow along.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.