diff options
-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="" |