Using a program from the Icon library (a symbol-manipulation language in the sense of SNOBOL):
# Utility functions: print-as-echo, print-line-with-visual-space.
pe() { for _i;do printf "%s" "$_i";done; printf "\n"; }
pl() { pe;pe "-----" ;pe "$*"; }
pl " Input data files" data?
head data?
pl " Expected output:"
head -v $E
# Insert strings like:
# The ID of the Josh Smith is 1
pl " Results:"
icon-paste "-The ID of the " data2 "- " data3 "- is " data1 |
tee f1
pl " Verify results if possible:"
C=$HOME/bin/pass-fail
[ -f $C ] && $C f1 "$E" || ( pe; pe " Results cannot be verified." ) >&2
producing:
-----
Input data files data1 data2 data3
==> data1 <==
1
2
3
==> data2 <==
Josh
Kate
Chris
==> data3 <==
Smith
Jones
Black
-----
Expected output:
==> expected-output <==
The ID of the Josh Smith is 1
The ID of the Kate Jones is 2
The ID of the Chris Black is 3
-----
Results:
The ID of the Josh Smith is 1
The ID of the Kate Jones is 2
The ID of the Chris Black is 3
-----
Verify results if possible:
-----
Comparison of 3 created lines with 3 lines of desired results:
Succeeded -- files (computed) f1 and (standard) expected-output have same content.
This was on a system like:
OS, ker|rel, machine: Linux, 3.16.0-7-amd64, x86_64
Distribution : Debian 8.11 (jessie)
Some details on icon-paste (lam.icn):
icon-paste paste, join, laminate lines from files. (man)
Path : ~/executable/icon-paste
Version : - ( local: ~/executable/icon-paste, 2012-02-11 )
Length : 24 lines
Type : POSIX shell script executable (binary data)
Shebang : #!/bin/sh
Home : https://www2.cs.arizona.edu/icon/library/src/progs/lam.icn (doc)
Information on Icon can be found at:
https://www2.cs.arizona.edu/icon/
Best wishes ... cheers, drl