summaryrefslogtreecommitdiff
path: root/vsvs-get
diff options
context:
space:
mode:
Diffstat (limited to 'vsvs-get')
-rw-r--r--vsvs-get25
1 files changed, 25 insertions, 0 deletions
diff --git a/vsvs-get b/vsvs-get
new file mode 100644
index 0000000..e7ab391
--- /dev/null
+++ b/vsvs-get
@@ -0,0 +1,25 @@
+#!/bin/bash
+res=""
+met=false
+while IFS="" read str
+do
+ if [ -z "${str##* *}" ]
+ then
+ key="${str%% *}"
+ val="${str#* }"
+ else
+ key="${str}"
+ val=""
+ fi
+ if [ -z "${key}" ] && [ $met == true ]
+ then
+ res="${res}"$'\n'"${val}"
+ elif [ "${key}" == "$1" ]
+ then
+ met=true
+ res="${val}"
+ else
+ met=false
+ fi
+done
+echo -n "${res}"