Learning and challenging days

Today I made a few bash scripts which read the data from the file and then process that data in a meaningful way by using Grass software. I have also learnt stuff related to contour by Grass software.

One interesting thing happened today

When I have given my bash script to Amarjeet and he runs my bash script as sh myscript.sh and it gave an error “Unexcepted token error [[” but on my laptop was working fine. On my laptop I run my bash script as ./myscript.sh and then after some time I found the answer that why script gives an error on Amarjeet’s laptop. Actually, he runs my script in sh shell whereas I have written my script according to the bash shell and then I told to Amarjeet to run my bash script as bash myscript.sh or as ./myscript.sh.

Powerline Plugin

Powerline is a plug-in to display informational and beautiful statusline for vim, tmux and shell prompt for bash, zsh.


Install python-pip and git: Run the following command in a terminal:

sudo apt-get install python-pip git

Then run the given below command to install Powerline plugin:

su -c 'pip install git+git://github.com/Lokaltog/powerline'

Installing fonts for Powerline:

wget https://github.com/Lokaltog/powerline/raw/develop/font/PowerlineSymbols.otf https://github.com/Lokaltog/powerline/raw/develop/font/10-powerline-symbols.conf
mkdir -p ~/.fonts/ && mv PowerlineSymbols.otf ~/.fonts/
fc-cache -vf ~/.fonts
mkdir -p ~/.config/fontconfig/conf.d/ && mv 10-powerline-symbols.conf ~/.config/fontconfig/conf.d/


    • Vim statusline:
      Add following to your ~/.vimrc or /etc/vim/vimrc:

      set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
      " Always show statusline
      set laststatus=2
      " Use 256 colours (Use this setting only if your terminal supports 256 colours)
      set t_Co=256


  • Bash prompt:
    Add the following line to your ~/.bashrc or /etc/bash.bashrc:

    if [ -f /usr/local/lib/python2.7/dist-packages/powerline/bindings/bash/powerline.sh ]; then
        source /usr/local/lib/python2.7/dist-packages/powerline/bindings/bash/powerline.sh


  • Zsh prompt:
    Add the following line to your ~/.zshrc or /etc/zsh/zshrc:

    if [[ -r /usr/local/lib/python2.7/dist-packages/powerline/bindings/zsh/powerline.zsh ]]; then
        source /usr/local/lib/python2.7/dist-packages/powerline/bindings/zsh/powerline.zsh
  • Tmux statusline:
    Add the following line to your ~/.tmux.conf:

    source /usr/local/lib/python2.7/dist-packages/powerline/bindings/tmux/powerline.conf
    set-option -g default-terminal "screen-256color"