jump.sh


#!/bin/bash
# FILE : jump.sh
# =======================================================
# add an entry in .bashrc or .bash_profile like this
# if [ -f /etc/jump.sh ]; then 	source /etc/jump.sh; fi
# or copy it as /etc/profile.d/jump.sh
# =======================================================

function jump
{
   pipename="$HOME/FifoJumpChdir"

   if [[ ! -p $pipename ]]; then
      mkfifo $pipename
   fi

   ( Jump.pm $*  & ) 2> /dev/null

   read line <$pipename
   if [[ $line != "" ]]; then cd $line; fi
   unlink $pipename
}