updated on Tue Jan 10 12:02:00 UTC 2012
[aur-mirror.git] / bashbookmarks / bash_bookmarks_function
blobcf01f812a32b74fd22fff78a5ad87244b817d684
1 #!/bin/bash
2 if [ ! -n "$BASH_BOOKMARKS" ];then export BASH_BOOKMARKS=$HOME/.bash_bookmarks;fi
3 if [ ! -d $BASH_BOOKMARKS ]; then mkdir -p $BASH_BOOKMARKS;fi
5 gat(){ if test -n "$1";then \
6 cd `cat $BASH_BOOKMARKS/$1`;\
7 cat $BASH_BOOKMARKS/$1;\
8 else \
9 for i in `find $BASH_BOOKMARKS -maxdepth 1 -type f`;\
10 do echo `basename $i`;\
11 done;\
12 fi;}
14 tag(){
15 if [ ! -d $BASH_BOOKMARKS ];then mkdir $BASH_BOOKMARKS;fi
16 if [ ! -n "$1" ];then echo "usage: tag <bookmark_name> .. will bookmark your current location under name <bookmark_name>";return 0;fi
17 pwd > $BASH_BOOKMARKS/$1