How about something like this example script. You will need to convert all the image characters to hex and prefix each with \x
#!/bin/bash shopt -s xpg_echo # set default for echo to recognize backslash-escape sequences (see man bash) echo "\x54\x68\x69\x73\x20\x69\x73\x20\ \x61\x20\x74\x65\x73\x74\x0a" > sample.txt cat sample.txt Alec Eduardo Sanz-Garcia wrote: > This is a crazy idea. Sorry for my ignorance. > I want to create a bash script that contains a binary file using a here > document: > > cat> image.jpg<<'Here_the_binary' > binary code > Here_the_binary > > It is not working. > Is there a way to create an script that auto contains a binary file, for > example an image? > -------------------- > BYU Unix Users Group > http://uug.byu.edu/ > > The opinions expressed in this message are the responsibility of their > author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG. > ___________________________________________________________________ > List Info: http://uug.byu.edu/mailman/listinfo/uug-list > > -------------------- BYU Unix Users Group http://uug.byu.edu/ The opinions expressed in this message are the responsibility of their author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG. ___________________________________________________________________ List Info: http://uug.byu.edu/mailman/listinfo/uug-list
