Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 19th, 2012  |  syntax: None  |  size: 0.99 KB  |  hits: 5  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function od() {
  2.         if [ $# != 0 ]; then
  3.                 if [ -e $1 ]; then
  4.                         cd $1;
  5.                         echo "moved : "$'\x1b[33m'`pwd`$'\x1b[0m';
  6.  
  7.                         # add log
  8.                         python ~/lab/py/cdhist/cdhist.py `pwd`;
  9.                         ls -GwF;
  10.                 elif [ $1 = "-s" ]; then
  11.                         if [ $# = 2 ]; then
  12.                                 cd $(python ~/lab/py/cdhist/suggest_directory.py $2)
  13.                                 echo "moved : "$'\x1b[33m'`pwd`$'\x1b[0m';
  14.                                 # add log
  15.                                 python ~/lab/py/cdhist/cdhist.py `pwd`;
  16.                                 ls -GwF;
  17.                         elif [ $# = 1 ]; then
  18.                                 python ~/lab/py/cdhist/suggest_directory.py
  19.  
  20.                         fi
  21.                 else
  22.                         echo "no such a file or directory :"$1;
  23.                 fi
  24.         else
  25.                 tail ~/.cd_history
  26. fi
  27. }