#!/bin/bash # # View a document. # # Parameters BASENAME="`basename $0`" DOCS="$HOME/data/doc" LIST="$DOCS/.filelist" ITEM="$1" # Check if [ -z "$ITEM" ]; then echo "usage: $BASENAME " exit 1 fi # Dispatch #find $DOCS -iname "*$ITEM*" | head -1 | while read item; do xdg-open "$item"; done grep "$ITEM" $LIST | while read item; do xdg-open "$item"; done