LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to insert a string into a binary file (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-insert-a-string-into-a-binary-file-4175436079/)

xombboxer 11-07-2012 08:32 AM

How to insert a string into a binary file
 
I want insert actual string into binary file, not the acsii value of the string

Its kind of xxd -r, but I am not getting intended result.
how can i do that ?

crabboy 11-07-2012 08:58 AM

What exactly are you trying to accomplish? Adding anything to a binary file will likely corrupt the file and make whatever program that reads the file unable to read it.

You can append text to any file with the >> shell operator. but again your file will be corrupt.

Code:

echo "appended text" >> somebinary
You can probably get away with replacing text in a binary so long as the text is the same length before and after.

michaelk 11-07-2012 08:59 AM

Reference:
http://www.linuxquestions.org/questi...le-4175436027/


All times are GMT -5. The time now is 06:39 PM.