+# Combine files $@ into a single file with comments between them which
+# allow splitting them back with fsplit.
+#
+# Assumes file names do not have newlines in them.
+fcomb() {
+ local f comment out
+ # generated with cat /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c8
+ comment='# jvvuyUsq '
+ out=~/fcomb
+ rm -f $out
+ for f; do
+ echo "$comment$f" >>$out
+ cat "$f" >>$out
+ done
+}
+fsplit() {
+ local f fin line fin_lines
+ fin=~/fcomb
+ line=1
+ fin_lines=$(wc -l "$fin" | awk '{print $1}')
+ comment='# jvvuyUsq '
+ while (( line <= fin_lines )); do
+ f=$(sed -n "${line}s/^$comment//p" "$fin")
+ sed -n "$line,/^$comment/{/^$comment/d;p}" "$fin" >"$f"
+ line=$(( line + 1 + $(wc -l "$f" | awk '{print $1}') ))
+ done
+}
+