diff options
Diffstat (limited to 'rvs/plugins/filecontent/bin/get.d.sh')
-rw-r--r-- | rvs/plugins/filecontent/bin/get.d.sh | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/rvs/plugins/filecontent/bin/get.d.sh b/rvs/plugins/filecontent/bin/get.d.sh index 1723d8a..1a001d3 100644 --- a/rvs/plugins/filecontent/bin/get.d.sh +++ b/rvs/plugins/filecontent/bin/get.d.sh @@ -19,12 +19,12 @@ ver=0.9 #. "$LIBDIR/@ID@/stdio" -# get.d ID DIRNAME -id="$1" -dir="$2" +usage="usage: $RVS get.d DIRNAME ID" +dir="${1?"$usage"}" + id="${2?"$usage"}" tmp=`mktemp` -"$RVS" get.f "$id" "$tmp" +"$RVS" get.f "$tmp" "$id" #install -d "$dir" mkdir -p "$dir" @@ -32,13 +32,9 @@ mkdir -p "$dir" cd "$dir" rm -rf ./* while read line; do - # GNU bash optimized version - #hash=${line/#*:/} - #name=${line/%:${hash}/} - # POSIX version - hash=`echo "$line" | sed 's/^.*://'` - name=`echo "$line" | sed "s/:$hash$//"` - "$RVS" get "$hash" "$name" + _id="`echo "$line" | sed 's/^.*://'`" + _name="`echo "$line" | sed 's@:'"$_id"'$@@'`" + "$RVS" get "$_name" "$_id" done < "$tmp" rm "$tmp" |