Open Rangi42 opened 6 days ago
I don't know enough about shell scripting to be able to tell offhand — can it be done? merge.sh
is a fairly short self-contained script; if you can rewrite it to use POSIX sh
, go for it.
The goal of the script is simple: given one or more input files (as command-line arguments), concatenate them into one large output file, copying any files included by #include "foo"
(but not #include <foo>
) into the output the first time (and only the first time) the filename is encountered. Note that all #include "foo"
statements are stripped by the copy process (the first time, the statement is replaced by the file; subsequent ones for the same file are just skipped).
Can this feasibly use POSIX sh?