function mark { ln -f -s `pwd` ~/.bookmarks/$1; } function go { cd -P ~/.bookmarks/$1; } alias lsmarks='ls -l ~/.bookmarks/' function _my_bookmark_complete { local word=${COMP_WORDS[COMP_CWORD]}; local bookmark_list=$(ls -1 ~/.bookmarks/); COMPREPLY=($(compgen -W "${bookmark_list}" -- ${word})) } export -f mark go complete -F _my_bookmark_complete go