diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2020-09-03 17:44:42 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2020-09-03 17:44:42 -0300 |
commit | 9bd4c3adcdad98963fb8b5701c671836c48d0118 (patch) | |
tree | 61a035e05049d9d4f7872f86e249704a6ac378a8 | |
parent | 8d7d159f010b796a830de551a851347eaae7ed0c (diff) | |
download | scripts-9bd4c3adcdad98963fb8b5701c671836c48d0118.tar.gz scripts-9bd4c3adcdad98963fb8b5701c671836c48d0118.tar.bz2 |
Feat: add basic show script
-rwxr-xr-x | show | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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 |