diff options
author | Aleksey Veresov <aleksey@veresov.pro> | 2020-12-06 17:51:22 +0300 |
---|---|---|
committer | Aleksey Veresov <aleksey@veresov.pro> | 2020-12-06 17:51:22 +0300 |
commit | c8550c2ba6bc3f80cbad499a6997d0b903580599 (patch) | |
tree | 5be0fd2eeafaae659fe476500ddf588d995b9e61 | |
parent | fc148d0a1e8fed57f097a0a1e0c6d84641132de7 (diff) | |
download | vsvs-c8550c2ba6bc3f80cbad499a6997d0b903580599.tar vsvs-c8550c2ba6bc3f80cbad499a6997d0b903580599.tar.xz vsvs-c8550c2ba6bc3f80cbad499a6997d0b903580599.zip |
.
-rw-r--r-- | vsvs-archive | 14 | ||||
-rw-r--r-- | vsvs-name | 7 | ||||
-rw-r--r-- | vsvs-parse (renamed from vsvs-parser) | 2 |
3 files changed, 23 insertions, 0 deletions
diff --git a/vsvs-archive b/vsvs-archive new file mode 100644 index 0000000..aea12ef --- /dev/null +++ b/vsvs-archive @@ -0,0 +1,14 @@ +#!/bin/bash +# Current directory will be represented as VSVS archive in output. +# The directory itself should be locked. +for e in `ls -a` +do + test "$e" == "." || test "$e" == ".." && continue + if test -f "$e" + then vsvs-name "$e" < $e + else + cd "$e" + vsvs-archive | vsvs-name "$e" + cd .. + fi +done diff --git a/vsvs-name b/vsvs-name new file mode 100644 index 0000000..709035c --- /dev/null +++ b/vsvs-name @@ -0,0 +1,7 @@ +#!/bin/bash +# Produce VSVS key-value pair in output, +# key is passed as $1, value is read from input. +echo -n "$1" +while IFS="" read line +do echo " $line" +done @@ -1,4 +1,6 @@ #!/bin/bash +# Iterate action over elements from VSVS input, +# action is passed as $1, it will be evaluated for each key-value pair. after () { test -z "${2##*$1*}" && echo -n "${2#*$1}"; } key="" value="" |