I was looking for something like:
filecontents *.sty | cat - main.tex > newmain.tex
It should be easy to write a script that iterating over its arguments, would wrap each in a filecontents
environment. I wonder if there is a standard such tool.
Here is a simple script that will do the job:
#!/bin/sh -f
for f in $* ; do
echo \\\\begin{filecontents}{$f}
cat $f
echo \\\\end{filecontents}
done
If there are no such standard tool, what would you like to see in one?