# $Id: book,v 1.4 2003/04/21 18:29:01 jsh Exp jsh $ bm() { eval bm_$1=$PWD; set | grep ^bm_ > $HOME/.book; } go() { . $HOME/.book; eval cd \$bm_$1; } bms() { if test $# -gt 0 && test $1 == "-r" then eval $(env | perl -lane 'print if s/^(bm_.*)=.*/unset $1;/') > $HOME/.book else cat $HOME/.book fi } return =head1 NAME bookmark - manage shell-level bookmarks =head1 SYNOPSIS bm [bookmarkname] go [bookmarkname] bms [-r] =head1 DESCRIPTION This suite of utilities manages shell-level bookmarks. =over 4 =item I set a bookmark =item I go to a preset bookmark =item I list the bookmarks =item I reset (clear) all bookmarks =back Bookmarks are preserved across login sessions and across windows. One unnamed bookmark is permitted at any time. (B: this file must be I. It can't just be executed.) =head1 FILES B<$HOME/.book> - list of bookmarks =head1 EXAMPLES # make a series of bookmarks $ cd /tmp; bm tmpdir $ cd ~/One/Two/Three/.../Infinity $ bm gamow $ cd $ bm myhome $ cd /usr/bin; bm # set the unnamed bookmark # list them $ bms bm_tmpdir=/tmp bm_gamow=/home/jsh/One/Two/Three/.../Infinity bm_myhome=/home/jsh bm_=/usr/bin # try them out $ go gamow; pwd /home/jsh/One/Two/Three/.../Infinity $ go; pwd /usr/bin # clear them all $ bms -r $ bms =head1 SEE ALSO L L =head1 AUTHOR Jeffrey Copeland Jeffrey S. Haemer =cut