Posts

Showing posts with the label bash

Setting the terminal window title - version 2

I had earlier written a small snippet about setting the window title from command line. Based on my experience, I felt that I could make it a lot simpler. Here is version of the same function. function wtitle {     if [ -z "$ORIG_PS1" ] ; then         ORIG_PS1=$PS1     fi     export PS1="\[\033]0;$1 - \u@\h:\w\007\]$ORIG_PS1" }

bashreduce - a MapReduce system using command line tools

I came across this interesting reading in Linux Magazine about bashreduce . Sounds interesting. You will also find it useful to read about Richard Crowley's extensions to bashreduce .

Customizing the colors in ls output

This posting is specific to customizing the dircolors in bash shell in Linux. It may or may not be applicable to other shells and other platforms. When the bash shell is started, it executes all the shell scripts under the directory /etc/profile.d/ *.sh . You might find other shell scripts under this directory (for e.g. colorls .csh ), but those scripts are not to be executed by the bash shell. These files are executed within the current shell's environment, not in a separate execed shell (like a dotshell). One of these files is colorsls.sh . A set of rules in colorls.sh search for the user specific dircolors file. This file could be any one of the ~/.dircolors, ~/.dircolors.$TERM, ~/.dir_colors or ~/.dir_colors.$TERM. In case the user has more then one of these files, whichever comes last will be taken. Let us stick to the convention of using ~/.dircolors file for our customization. It is very easy to create this file by giving the following command: dircolors --sh > ~/.dircolo...