#----------------------------------------------------------------------
# Text functions.
+# Head of a list.
+pure function head (xs) returning string = @{
+ for f in %xs; do
+ echo "$f"
+ exit 0
+ done
+}
+
# Join two lists.
pure function join (xs, ys) returning strings = @{
for f in %xs %ys; do echo "$f"; done
echo %text | sed -E s/%from/$to/g
}
+# Tail of a list.
+pure function tail (xs) returning strings = @{
+ drop=1
+ for f in %xs; do
+ if [ -z "$drop" ]; then echo "$f"; fi
+ drop=
+ done
+}
+
#----------------------------------------------------------------------
# File functions.