From: Silvio Rhatto Date: Thu, 3 Sep 2020 20:44:42 +0000 (-0300) Subject: Feat: add basic show script X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=9bd4c3adcdad98963fb8b5701c671836c48d0118;p=scripts.git Feat: add basic show script --- 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 " + exit 1 +fi + +# Dispatch +find $DOCS -iname "*$ITEM*" | head -1 | while read item; do xdg-open "$item"; done