src:unix programming environment
a shell script ./bundle :it works well with text file but binary code :(
#!/bin/bash
echo '# To unbundle , sh this file'
for i
do
echo "echo $i 1>&2"
echo "cat >$i <<'End of $i'"
cat $i
echo "End of $i"
done
a simple binary file named a.out,
% ./bundle a.out >> out
% chmod u+x out
% ./out # error happened
I got:
./out: line 8: warning: here-document at line 3 delimited by end-of-file (wanted `End of a.out')
yeah, I know the `End of a.out' should be in a seprate line. But I don't know how to implemetate it.
who have some idea?
thx in advance. :D