Add a new utility called file2c(1) to othersrc, which converts its
input stream into individual bytes, suitable for inclusion as a C
source file. This kind of utility is occasionally useful for
embedding data in C-derived libraries and executables. The utility is
similar in function, and arguments, to the utility written in C, and
included in FreeBSD. This version of the utility just uses awk(1),
and so is written as a simple shell script.
Example usage:
% echo 'Hello world' | file2c -sx 'static const char *text = {\n' '};\n'
static const char *text = {
0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x77, 0x6f, 0x72, 0x6c,
0x64, 0xa
};
%
UnifiedSplitRaw