I'm writing a shell script that appends binary contents to a file. I tried using this command:
echo -en '\x61\x62\x63..' >> /tmp/myfile
but that caused the following output:
-en \x61\x62\x63..
Is there any way I could append the contents to a file rather than having to remove all contents every time?
Note
I'm trying to do this on a system that only has /bin/sh
, this command works fine with bash
but not when using the default shell.
'\x61\x62\x63..'
or print'abc..'
to /tmp/myfile? – cuonglm Jun 20 '15 at 19:20