aboutsummaryrefslogtreecommitdiff
path: root/show
diff options
context:
space:
mode:
Diffstat (limited to 'show')
-rwxr-xr-xshow18
1 files changed, 18 insertions, 0 deletions
diff --git a/show b/show
new file mode 100755
index 0000000..b822af5
--- /dev/null
+++ b/show
@@ -0,0 +1,18 @@
+#!/bin/bash
+#
+# View a document.
+#
+
+# Parameters
+BASENAME="`basename $0`"
+DOCS="$HOME/data/doc"
+ITEM="$1"
+
+# Check
+if [ -z "$ITEM" ]; then
+ echo "usage: $BASENAME <item-name>"
+ exit 1
+fi
+
+# Dispatch
+find $DOCS -iname "*$ITEM*" | head -1 | while read item; do xdg-open "$item"; done