aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2020-09-03 17:44:42 -0300
committerSilvio Rhatto <rhatto@riseup.net>2020-09-03 17:44:42 -0300
commit9bd4c3adcdad98963fb8b5701c671836c48d0118 (patch)
tree61a035e05049d9d4f7872f86e249704a6ac378a8
parent8d7d159f010b796a830de551a851347eaae7ed0c (diff)
downloadscripts-9bd4c3adcdad98963fb8b5701c671836c48d0118.tar.gz
scripts-9bd4c3adcdad98963fb8b5701c671836c48d0118.tar.bz2
Feat: add basic show script
-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