summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vsvs-extract6
-rw-r--r--vsvs-locate3
-rw-r--r--vsvs-parse4
3 files changed, 7 insertions, 6 deletions
diff --git a/vsvs-extract b/vsvs-extract
index a45d231..3db8bdc 100644
--- a/vsvs-extract
+++ b/vsvs-extract
@@ -1,6 +1,8 @@
#!/bin/bash
-after () { test -z "${2##*$1*}" && echo -n "${2#*$1}" }
-vsvs-locate "$2" | { read path; read vsvspath; } || exit 1
+after () { test -z "${2##*$1*}" && echo -n "${2#*$1}"; }
+res="$(vsvs-locate "$2" || exit 1)"
+path="${res%% *}"
+vsvspath=$(after " " "$res")
if test -f "$path"
then
lockfile="$base/proc/$proc/lock/"
diff --git a/vsvs-locate b/vsvs-locate
index 21df2ac..1b7f080 100644
--- a/vsvs-locate
+++ b/vsvs-locate
@@ -10,5 +10,4 @@ do
lastpath=$(after / "$lastpath")
test -e "$path" || exit 1
done
-echo "$path"
-echo "$lastpath"
+echo "$path $lastpath"
diff --git a/vsvs-parse b/vsvs-parse
index 2992136..27e51a4 100644
--- a/vsvs-parse
+++ b/vsvs-parse
@@ -9,9 +9,9 @@ do
if test -z "${line%% *}"
then value="${value}"$'\n'"$(after " " "$line")"
else
- test -z "$key" && eval $1
+ test -n "$key" && eval $1
key="${line%% *}"
value="$(after " " "$line")"
fi
done
-test -z "$key" && eval $1
+test -n "$key" && eval $1